sessions

package
v1.0.0-beta.10 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InstanceState

type InstanceState struct {
	Instance *instance.State `json:"instance"`
	Error    error           `json:"error"`
}

type Manager

type Manager interface {
	RequestSession(names []string, duration time.Duration) *SessionState
	RequestReadySession(names []string, duration time.Duration, timeout time.Duration) (*SessionState, error)

	LoadSessions(io.ReadCloser) error
	SaveSessions(io.WriteCloser) error
}

func NewSessionsManager

func NewSessionsManager(store tinykv.KV[instance.State], provider providers.Provider) Manager

type SessionState

type SessionState struct {
	Instances *sync.Map
}

func (*SessionState) IsReady

func (s *SessionState) IsReady() bool

func (*SessionState) MarshalJSON

func (s *SessionState) MarshalJSON() ([]byte, error)

func (*SessionState) Status

func (s *SessionState) Status() string

type SessionsManager

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

func (*SessionsManager) ExpiresAfter

func (s *SessionsManager) ExpiresAfter(instance *instance.State, duration time.Duration)

func (*SessionsManager) LoadSessions

func (sm *SessionsManager) LoadSessions(reader io.ReadCloser) error

func (*SessionsManager) RequestReadySession

func (s *SessionsManager) RequestReadySession(names []string, duration time.Duration, timeout time.Duration) (*SessionState, error)

func (*SessionsManager) RequestSession

func (s *SessionsManager) RequestSession(names []string, duration time.Duration) (sessionState *SessionState)

func (*SessionsManager) SaveSessions

func (sm *SessionsManager) SaveSessions(writer io.WriteCloser) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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