{"modulePath":"github.com/threefoldtech/web3_proxy/server","version":"v0.0.0-20230905100307-0269a1e6aecb","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package state\n\n## Functions\n\n```go\nfunc IDFromContext(ctx context.Context) string\n```\n\n## Types\n\n```go\ntype State interface{}\n```\n\n```go\ntype StateManager[S State] struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewStateManager[S State]() *StateManager[S]\n```\n\n```go\nfunc (sm *StateManager[S]) Close()\n```\nClose the StateManager, cleaning up the background worker. It should not be used after this call.\n\n```go\nfunc (sm *StateManager[S]) Get(conID string) (S, bool)\n```\nGet a previously saved state for a connection ID. If the connection ID is not present in the map, a blank state will be returned\n\n```go\nfunc (sm *StateManager[S]) Set(conID string, state S)\n```\nSet state for a connection ID. Previously saved state will be overriden.\n\n","path":"github.com/threefoldtech/web3_proxy/server/pkg/state","name":"state","synopsis":"","isRedistributable":true}
