state

package
v0.0.0-...-c2b5c71 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package state implements state capabilties for integrations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Persistence

type Persistence interface {
	Exists(context.Context, string) (bool, error)
	Add(context.Context, string, interface{}) error
	Rm(context.Context, string) error
	Get(context.Context, string, interface{}) error
}

Persistence is an interface for state management

type S3State

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

S3State implements Persistence using AWS S3 as a backend

func NewS3State

func NewS3State(basePath, infix string, client aws.Client) *S3State

NewS3State creates a new S3State Persistence object

func (*S3State) Add

func (s *S3State) Add(ctx context.Context, key string, value interface{}) error

Add adds a given state to S3

func (*S3State) Exists

func (s *S3State) Exists(ctx context.Context, key string) (bool, error)

Exists checks if a given state exists in S3

func (*S3State) Get

func (s *S3State) Get(ctx context.Context, key string, value interface{}) error

Get retrieves a state from S3

func (*S3State) Rm

func (s *S3State) Rm(ctx context.Context, key string) error

Rm removes a state from S3

Jump to

Keyboard shortcuts

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