system

package
v1.18.3 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() error

Init initialize AppState interface

Types

type DBStore

type DBStore struct{}

DBStore can be used to store app state items in local filesystem

func (*DBStore) Get

func (f *DBStore) Get(item StateItem) error

Get reads the state item

func (*DBStore) Set

func (f *DBStore) Set(item StateItem) error

Set saves the state item

type RuntimeState

type RuntimeState struct {
	LastAppPath    string `json:"last_app_path"`
	LastCustomConf string `json:"last_custom_conf"`
}

RuntimeState contains app state for runtime, and we can save remote version for update checker here in future

func (RuntimeState) Name

func (a RuntimeState) Name() string

Name returns the item name

type StateItem

type StateItem interface {
	Name() string
}

StateItem provides the name for a state item. the name will be used to generate filenames, etc

type StateStore

type StateStore interface {
	Get(item StateItem) error
	Set(item StateItem) error
}

StateStore is the interface to get/set app state items

var AppState StateStore

AppState contains the state items for the app

Jump to

Keyboard shortcuts

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