state

package
v0.0.0-...-2e804f1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2023 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOrCreateStateFromFile

func GetOrCreateStateFromFile(ctx context.Context, logger *zerolog.Logger, path string) (*fileStateHandler, error)

example input: file:///tmp/state.json

Types

type State

type State interface {
	GetState() *standardState
	GetCtx() context.Context
	GetLogger() *zerolog.Logger
	AutoCommit(interval time.Duration)
	Close() error
}

State is an interface that defines how to read and write the state

func GetOrCreateStateFromURI

func GetOrCreateStateFromURI(ctx context.Context, logger *zerolog.Logger, uri url.URL, interval time.Duration) (State, error)

GetOrCreateStateFromURI creates a new state if it doesn't exist on the URI provided. URI can be a file path, a database connection string, or an etcd connection string Currently, only file path is supported

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳