state

package
v0.0.0-...-01a409d Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientState

type ClientState struct {
	Name            string
	LastValue       []*github.WorkflowRun
	LastRequest     time.Time
	Status          Status
	NextForcedScale *time.Time
}

func NewClientState

func NewClientState(name string) *ClientState

type IStateProvider

type IStateProvider interface {
	GetState(key string) (*ClientState, error)
	SetState(key string, state *ClientState) error
	GetWorkflowInfo(key string) (*map[int64]utils.WorkflowInfo, error)
	SetWorkflowInfo(key string, wfInfo *map[int64]utils.WorkflowInfo) error
}

type InMemoryStateProvider

type InMemoryStateProvider struct {
	ClientStateData map[string]ClientState

	WorkflowInfo map[string]map[int64]utils.WorkflowInfo
	// contains filtered or unexported fields
}

func NewInMemoryStateProvider

func NewInMemoryStateProvider() *InMemoryStateProvider

func NewInMemoryStateProviderWithData

func NewInMemoryStateProviderWithData(data map[string]ClientState) *InMemoryStateProvider

func (*InMemoryStateProvider) GetState

func (p *InMemoryStateProvider) GetState(key string) (*ClientState, error)

func (*InMemoryStateProvider) GetWorkflowInfo

func (p *InMemoryStateProvider) GetWorkflowInfo(key string) (*map[int64]utils.WorkflowInfo, error)

func (*InMemoryStateProvider) SetState

func (p *InMemoryStateProvider) SetState(key string, state *ClientState) error

func (*InMemoryStateProvider) SetWorkflowInfo

func (p *InMemoryStateProvider) SetWorkflowInfo(key string, state *map[int64]utils.WorkflowInfo) error

type MemcachedStateProvider

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

func NewMemcachedStateProvider

func NewMemcachedStateProvider(servers string, username string, argPassword string) (*MemcachedStateProvider, error)

func (*MemcachedStateProvider) GetState

func (p *MemcachedStateProvider) GetState(key string) (*ClientState, error)

func (*MemcachedStateProvider) GetWorkflowInfo

func (p *MemcachedStateProvider) GetWorkflowInfo(key string) (*map[int64]utils.WorkflowInfo, error)

func (*MemcachedStateProvider) SetState

func (p *MemcachedStateProvider) SetState(key string, state *ClientState) error

func (*MemcachedStateProvider) SetWorkflowInfo

func (p *MemcachedStateProvider) SetWorkflowInfo(key string, wfInfo *map[int64]utils.WorkflowInfo) error

type Status

type Status int8
const (
	Unset Status = iota
	Valid
	Errored
)

Jump to

Keyboard shortcuts

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