Documentation ¶
Index ¶
Constants ¶
View Source
const ( QPath = "path" QType = "type" TypeAll = "all" TypeSeal = "sealOnly" )
View Source
const ( ContentKey = "Content-Type" JsonContent = "application/json" PlainContent = "text/plain" HPIsRW = "X-is-RW" )
Variables ¶
This section is empty.
Functions ¶
func NewDirHandler ¶
func NewStateHandler ¶
func NewStateHandler(onStateChange func(bool, bool, api.Result, string), socketURL string) *restHandler
Returns a usable REST handler. The callback allows to respond to State-changes, calls to it are synchronized and thus serial only. f(isEnd, result) - isEnd is True only when the operation is now finished, result is nil in that case If isEnd is false and result is nil, this indicates that our State changed
Types ¶
type ItemInfo ¶
type ItemInfo struct { Item string `json:"item"` Path string `json:"path"` IsDir bool `json:"isDir"` }
Simple json compatible structure which identifies an item within a directory It also signals if it is a file
type State ¶
type State struct { Mode string `json:"mode"` Verbosity string `json:"verbosity"` Spid int `json:"spid"` // streams per input device Spod int `json:"spod"` // streams per output device Fep []string `json:"fep"` // file exclude patterns Sources []string `json:"sources"` // The sources for verify and seal Destinations []string `json:"destinations"` // The destinations of sealed-copy Verify string `json:"verify"` // if non-empty, verification is done after a sealed copy Format string `json:"format"` // The serialization format of seals SocketURL string `json:"socketURL"` // read-only URL of the web-socket people can connect to IsRunning bool `json:"status"` // read-only, true if an operation is in progress LastError string `json:executionError` // error result of the last operation }
A struct for json serialization and deserialization
Click to show internal directories.
Click to hide internal directories.