connstate

package
v1.19.2 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager can save and load a connector's internal state into a remote storage

func NewManager

func NewManager(repo Repo, logger logrus.FieldLogger) (*Manager, error)

NewManager for Connector State

func (*Manager) GetInitialState

func (m *Manager) GetInitialState() json.RawMessage

GetInitialState is only supposed to be used during initialization of the connector.

func (*Manager) SetState

func (m *Manager) SetState(ctx context.Context, state json.RawMessage) error

SetState form outside (i.e. from the connector)

type Repo

type Repo interface {
	Save(ctx context.Context, state json.RawMessage) error
	Load(ctx context.Context) (json.RawMessage, error)
}

Repo describes the dependencies of the connector state manager to an external storage

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL