Documentation ¶
Index ¶
- Constants
- func Execute()
- func FindAll(mds metastore.Client, search string) ([]*snapshot.Snapshot, []*branch.Branch, []*volume.Volume, error)
- func FindBranches(mds metastore.Syncable, search string) ([]*branch.Branch, error)
- func FindSnapshots(mds metastore.Syncable, search string) ([]*snapshot.Snapshot, error)
- func FindVolumes(mds metastore.Client, search string) ([]*volume.Volume, error)
- func FindVolumesets(mds metastore.Syncable, search string) ([]*volumeset.VolumeSet, error)
- type AnalyticsLogger
- type CmdOutput
- type CmdResult
- type CommandHandler
- type Config
- type ConfigParams
- type ErrBranchNotFound
- type ErrConfigFileNotFound
- type ErrInvalidArgs
- type ErrInvalidAttrFormat
- type ErrInvalidSearch
- type ErrMissingFlag
- type ErrSnapshotNotFound
- type ErrVolSetNotFound
- type ErrVolumeNotFound
- type Handler
- func (c *Handler) Clone(attributes string, full bool, args []string) (Result, error)
- func (c *Handler) Config(url string, token string, offline bool, args []string) (Result, error)
- func (c *Handler) Create(attributes string, full bool, args []string) (Result, error)
- func (c *Handler) Diagnostics(args []string) (Result, error)
- func (c *Handler) Fetch(url string, token string, all bool, full bool, args []string) (Result, error)
- func (c *Handler) Info(args []string) (Result, error)
- func (c *Handler) Init(attributes string, description string, args []string) (Result, error)
- func (c *Handler) List(all bool, volumeFlag bool, snapshotFlag bool, branchFlag bool, full bool, ...) (Result, error)
- func (c *Handler) Pull(url string, token string, full bool, args []string) (Result, error)
- func (c *Handler) Push(url string, token string, full bool, args []string) (Result, error)
- func (c *Handler) Remove(full bool, args []string) (Result, error)
- func (c *Handler) Setup(zpool string, force bool, args []string) (Result, error)
- func (c *Handler) Snapshot(branchName string, newBranch bool, attributes string, description string, ...) (Result, error)
- func (c *Handler) Sync(url string, token string, all bool, full bool, args []string) (Result, error)
- func (c *Handler) Update(name string, attributes string, description string, full bool, args []string) (Result, error)
- func (c *Handler) Version(args []string) (Result, error)
- type ListResult
- type Result
Constants ¶
const ( // LogDir ... LogDir = "/var/log/fli" // CmdLogFilename ... CmdLogFilename = "cmd.log" // FliLogFilename ... FliLogFilename = "fli.log" )
Variables ¶
This section is empty.
Functions ¶
func FindAll ¶
func FindAll(mds metastore.Client, search string) ([]*snapshot.Snapshot, []*branch.Branch, []*volume.Volume, error)
FindAll ...
func FindBranches ¶
FindBranches reports whether the search matches the Branches in mds search syntax is
search: {volumeset}:{branch} {branch} volumeset: c8980031-b0ba e6296a4a-b481-406c-9d33-ae074c6df78b /chq/volset/name /chq/volset* /chq/volset? (empty string) branch: br* * (empty string)
func FindSnapshots ¶
FindSnapshots reports whether the search matches the Snapshots in mds search syntax is
search: {volumeset}:{snapshot} {snapshot} volumeset: c8980031-b0ba e6296a4a-b481-406c-9d33-ae074c6df78b /chq/volset/name /chq/volset* /chq/volset? (empty string) snapshot: c8980031-b0ba e6296a4a-b481-406c-9d33-ae074c6df78b snap* * (empty string)
func FindVolumes ¶
FindVolumes reports whether the search matches the Volume in mds search syntax is
search: {volumeset}:{volume} {volume} volumeset: c8980031-b0ba e6296a4a-b481-406c-9d33-ae074c6df78b /chq/volset/name /chq/volset* /chq/volset? (empty string) volume: c8980031-b0ba e6296a4a-b481-406c-9d33-ae074c6df78b vol* * (empty string)
func FindVolumesets ¶
FindVolumesets reports whether the search matches the VolumeSets in mds search syntax is
search: c8980031-b0ba e6296a4a-b481-406c-9d33-ae074c6df78b /chq/volset/name /chq/volset* /chq/volset? (empty string)
Types ¶
type AnalyticsLogger ¶
type AnalyticsLogger struct {
// contains filtered or unexported fields
}
AnalyticsLogger logs analytics related information to FlockerHub
func NewAnalyticsLogger ¶
func NewAnalyticsLogger(server string, tokenfile string) *AnalyticsLogger
NewAnalyticsLogger ...
func (*AnalyticsLogger) LogConfig ¶
func (al *AnalyticsLogger) LogConfig() error
LogConfig log fli config event
type CommandHandler ¶
type CommandHandler interface { Clone(attributes string, full bool, args []string) (Result, error) Config(url string, token string, offline bool, args []string) (Result, error) Create(attributes string, full bool, args []string) (Result, error) Init(attributes string, description string, args []string) (Result, error) List(all bool, volume bool, snapshot bool, branch bool, full bool, args []string) (Result, error) Pull(url string, token string, full bool, args []string) (Result, error) Push(url string, token string, full bool, args []string) (Result, error) Remove(full bool, args []string) (Result, error) Setup(zpool string, force bool, args []string) (Result, error) Snapshot(branch string, newbranch bool, attributes string, description string, full bool, args []string) (Result, error) Sync(url string, token string, all bool, full bool, args []string) (Result, error) Fetch(url string, token string, all bool, full bool, args []string) (Result, error) Update(name string, attributes string, description string, full bool, args []string) (Result, error) Version(args []string) (Result, error) Info(args []string) (Result, error) Diagnostics(args []string) (Result, error) }
CommandHandler inteface that implements handlers for cli commands
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config ...
func (*Config) CreateFile ¶
CreateFile creates a configuration file
func (*Config) ReadConfig ¶
func (y *Config) ReadConfig() (ConfigParams, error)
ReadConfig reads the configuration
func (*Config) UpdateConfig ¶
func (y *Config) UpdateConfig(cfg ConfigParams) error
UpdateConfig updates on the on-disk configuration with the in-memory configuration updates
type ConfigParams ¶
type ConfigParams struct { SQLMdsCurrent string `yaml:"current,omitempty"` SQLMdsInitial string `yaml:"initial,omitempty"` FlockerHubURL string `yaml:"url,omitempty"` AuthTokenFile string `yaml:"token,omitempty"` Zpool string `yaml:"zpool,omitempty"` Version string `yaml:"version,omitempty"` }
ConfigParams ...
type ErrBranchNotFound ¶
type ErrBranchNotFound struct {
Name string
}
ErrBranchNotFound ...
func (ErrBranchNotFound) Error ¶
func (e ErrBranchNotFound) Error() string
type ErrConfigFileNotFound ¶
type ErrConfigFileNotFound struct{}
ErrConfigFileNotFound ...
func (ErrConfigFileNotFound) Error ¶
func (e ErrConfigFileNotFound) Error() string
type ErrInvalidArgs ¶
type ErrInvalidArgs struct{}
ErrInvalidArgs ...
func (ErrInvalidArgs) Error ¶
func (e ErrInvalidArgs) Error() string
type ErrInvalidAttrFormat ¶
type ErrInvalidAttrFormat struct {
// contains filtered or unexported fields
}
ErrInvalidAttrFormat ...
func (ErrInvalidAttrFormat) Error ¶
func (e ErrInvalidAttrFormat) Error() string
type ErrInvalidSearch ¶
type ErrInvalidSearch struct {
// contains filtered or unexported fields
}
ErrInvalidSearch ..
func (ErrInvalidSearch) Error ¶
func (e ErrInvalidSearch) Error() string
type ErrMissingFlag ¶
type ErrMissingFlag struct {
FlagName string
}
ErrMissingFlag ...
func (ErrMissingFlag) Error ¶
func (e ErrMissingFlag) Error() string
type ErrSnapshotNotFound ¶
type ErrSnapshotNotFound struct {
Name string
}
ErrSnapshotNotFound ...
func (ErrSnapshotNotFound) Error ¶
func (e ErrSnapshotNotFound) Error() string
type ErrVolSetNotFound ¶
type ErrVolSetNotFound struct {
Name string
}
ErrVolSetNotFound ...
func (ErrVolSetNotFound) Error ¶
func (e ErrVolSetNotFound) Error() string
type ErrVolumeNotFound ¶
type ErrVolumeNotFound struct {
Name string
}
ErrVolumeNotFound ...
func (ErrVolumeNotFound) Error ¶
func (e ErrVolumeNotFound) Error() string
type Handler ¶
type Handler struct { CfgParams ConfigParams ConfigFile string MdsPathCurrent string MdsPathInitial string FliLogFile string // contains filtered or unexported fields }
Handler ...
func NewHandler ¶
func NewHandler(params ConfigParams, cfgFile, mdsCurr, mdsInit string) *Handler
NewHandler ...
func (*Handler) Clone ¶
Clone create a volume from source which could be a snapshot or a branch if more than 1 match found for branch & snapshot together should return the matching result found
func (*Handler) Diagnostics ¶
Diagnostics ...
func (*Handler) Fetch ¶
func (c *Handler) Fetch(url string, token string, all bool, full bool, args []string) (Result, error)
Fetch ...
func (*Handler) List ¶
func (c *Handler) List( all bool, volumeFlag bool, snapshotFlag bool, branchFlag bool, full bool, args []string, ) (Result, error)
List ...
func (*Handler) Snapshot ¶
func (c *Handler) Snapshot(branchName string, newBranch bool, attributes string, description string, full bool, args []string) (Result, error)
Snapshot ...
func (*Handler) Sync ¶
func (c *Handler) Sync(url string, token string, all bool, full bool, args []string) (Result, error)
Sync ...
type ListResult ¶
type ListResult struct {
// contains filtered or unexported fields
}
ListResult represent the result from list command.
func (ListResult) JSON ¶
func (r ListResult) JSON() string
JSON translates the list result to JSON string.
func (ListResult) String ¶
func (r ListResult) String() string
type Result ¶
type Result interface { // String turns result into regular human readable string. String() string // JSON turns result into JSON string. JSON() string }
Result interfaces the cmd output of each of the handlers. Each of the handlers should write their own cmd output format and should be able to output it as string or JSON string.