store

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State struct {
	Users     map[string]model.User         `json:"users"`
	Tokens    map[string]model.Token        `json:"tokens"`
	Nodes     map[string]model.Node         `json:"nodes"`
	Tasks     map[string]model.Task         `json:"tasks"`
	Results   []model.TaskResult            `json:"results"`
	Audit     []model.AuditEvent            `json:"audit"`
	KV        map[string]model.KVEntry      `json:"kv"`
	Static    map[string]model.StaticObject `json:"static"`
	Workers   map[string]model.WorkerScript `json:"workers"`
	Approvals map[string]model.Approval     `json:"approvals"`
}

type Store

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

func Open

func Open(path string) (*Store, error)

func (*Store) AddTaskResult

func (s *Store) AddTaskResult(r model.TaskResult) error

func (*Store) AppendAudit

func (s *Store) AppendAudit(ev model.AuditEvent) error

func (*Store) Approval

func (s *Store) Approval(id string) (model.Approval, bool)

func (*Store) Approvals

func (s *Store) Approvals() []model.Approval

func (*Store) AuditEvents

func (s *Store) AuditEvents() []model.AuditEvent

func (*Store) CreateTask

func (s *Store) CreateTask(t model.Task) error

func (*Store) KV

func (s *Store) KV(bucket string) []model.KVEntry

func (*Store) LeaseTasks

func (s *Store) LeaseTasks(nodeID string, limit int) ([]model.Task, error)

func (*Store) Node

func (s *Store) Node(id string) (model.Node, bool)

func (*Store) Nodes

func (s *Store) Nodes() []model.Node

func (*Store) PutKV

func (s *Store) PutKV(entry model.KVEntry) error

func (*Store) PutStatic

func (s *Store) PutStatic(obj model.StaticObject) error

func (*Store) Results

func (s *Store) Results() []model.TaskResult

func (*Store) Save

func (s *Store) Save() error

func (*Store) Static

func (s *Store) Static(bucket string) []model.StaticObject

func (*Store) Tasks

func (s *Store) Tasks() []model.Task

func (*Store) Tokens

func (s *Store) Tokens() []model.Token

func (*Store) UpdateMetrics

func (s *Store) UpdateMetrics(nodeID string, metrics model.Metrics, version, publicIP, wgIP string) error

func (*Store) UpsertApproval

func (s *Store) UpsertApproval(a model.Approval) error

func (*Store) UpsertNode

func (s *Store) UpsertNode(n model.Node) error

func (*Store) UpsertToken

func (s *Store) UpsertToken(t model.Token) error

func (*Store) UpsertUser

func (s *Store) UpsertUser(u model.User) error

func (*Store) UpsertWorker

func (s *Store) UpsertWorker(w model.WorkerScript) error

func (*Store) User

func (s *Store) User(id string) (model.User, bool)

func (*Store) UserByUsername

func (s *Store) UserByUsername(username string) (model.User, bool)

func (*Store) Workers

func (s *Store) Workers() []model.WorkerScript

Jump to

Keyboard shortcuts

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