Go to file
kekskurse bc5c7d6f9e init 2024-03-04 11:20:04 +01:00
.gitignore init 2024-03-04 11:20:04 +01:00
Readme.md init 2024-03-04 11:20:04 +01:00
error.go init 2024-03-04 11:20:04 +01:00
go.mod init 2024-03-04 11:20:04 +01:00
go.sum init 2024-03-04 11:20:04 +01:00
state.go init 2024-03-04 11:20:04 +01:00
state_test.go init 2024-03-04 11:20:04 +01:00

Readme.md

State

From time to time i need some small state persistens like e.g. for a bot how count the numbers of messages with a special value. I want to store them somewhere to not cound double without thin king about it so i store a struct as json.

This pkg will provice Methodes to store (read and write) structs to the hdd.

Idear for later:

  • Store in S3 as well
  • Function for dealing with lists on store. Like add to list, chcik if exists in list and so on

Working with State

Write State to HDD

state, err := NewLocaleFilesystem("data/")
if err != nil {
    panic(err)
}