common

package
v0.0.0-...-c88c7c2 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Files embed.FS

Functions

func GetGraphTemplateData

func GetGraphTemplateData() interface{}

func WriteArchive

func WriteArchive(w io.Writer, filenameBase string, state StateChange, rawData bool) (err error)

Types

type Client

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

func NewClient

func NewClient(config dsl.Config) *Client

func (*Client) Close

func (c *Client) Close()

func (*Client) RegisterReceiver

func (c *Client) RegisterReceiver(receiver chan StateChange)

func (*Client) SetEncryptionPassphrase

func (c *Client) SetEncryptionPassphrase(encryptionPassphrase string) error

func (*Client) SetPassphrase

func (c *Client) SetPassphrase(passphrase string) error

func (*Client) SetPassword

func (c *Client) SetPassword(password string) error

func (*Client) State

func (c *Client) State() StateChange

func (*Client) UnregisterReceiver

func (c *Client) UnregisterReceiver(receiver chan StateChange)

type Message

type Message struct {
	State string      `json:"state"`
	Info  interface{} `json:"info,omitempty"`
	Data  interface{} `json:"data,omitempty"`
}

func GetStateMessage

func GetStateMessage(change StateChange) Message

func (Message) JSON

func (m Message) JSON() []byte

type MessageData

type MessageData struct {
	Summary       string          `json:"summary"`
	Bins          json.RawMessage `json:"bins"`
	BinsHistory   json.RawMessage `json:"bins_history"`
	ErrorsHistory json.RawMessage `json:"errors_history"`
}

type State

type State string
const (
	StateReady                        State = "ready"
	StatePasswordRequired             State = "password"
	StatePassphraseRequired           State = "passphrase"
	StateEncryptionPassphraseRequired State = "encryption-passphrase"
	StateLoading                      State = "loading"
	StateError                        State = "error"
)

type StateChange

type StateChange struct {
	State State

	HasData       bool
	Time          time.Time
	RawData       []byte
	Status        models.Status
	Bins          models.Bins
	BinsHistory   models.BinsHistory
	ErrorsHistory models.ErrorsHistory

	Fingerprint string

	Err error
}

Jump to

Keyboard shortcuts

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