{"modulePath":"github.com/shieldproject/shield","version":"v8.7.0+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package plugin\n\n## Constants\n\n```go\nconst ENDPOINT_BAD_DATA = 13\n```\n\n```go\nconst ENDPOINT_MISSING_KEY = 12\n```\n\n```go\nconst EXEC_FAILURE = 3\n```\n\n```go\nconst JSON_FAILURE = 10\n```\n\n```go\nconst NOPIPE = 0\n```\n\n```go\nconst PLUGIN_FAILURE = 4\n```\n\n```go\nconst RESTORE_KEY_REQUIRED = 11\n```\n\n```go\nconst STDIN = 1\n```\n\n```go\nconst STDOUT = 2\n```\n\n```go\nconst SUCCESS = 0\n```\n\n```go\nconst UNSUPPORTED_ACTION = 2\n```\n\n```go\nconst USAGE = 1\n```\n\n## Variables\n\n```go\nvar UNIMPLEMENTED = UnsupportedActionError{}\n```\n\n## Functions\n\n```go\nfunc DEBUG(format string, args ...interface{})\n```\n\n```go\nfunc Debugf(f string, args ...interface{})\n```\n\n```go\nfunc Exec(cmdString string, flags int) error\n```\n\n```go\nfunc ExecWithOptions(opts ExecOptions) error\n```\n\n```go\nfunc GenUUID() string\n```\n\n```go\nfunc Infof(f string, args ...interface{})\n```\n\n```go\nfunc Redact(raw string) string\n```\n\n```go\nfunc Run(p Plugin)\n```\n\n## Types\n\n```go\ntype EndpointDataTypeMismatchError struct {\n\tKey         string\n\tDesiredType string\n}\n```\n\n```go\nfunc (e EndpointDataTypeMismatchError) Error() string\n```\n\n```go\ntype EndpointMissingRequiredDataError struct {\n\tKey string\n}\n```\n\n```go\nfunc (e EndpointMissingRequiredDataError) Error() string\n```\n\n```go\ntype ExecFailure struct {\n\tErr string\n}\n```\n\n```go\nfunc (e ExecFailure) Error() string\n```\n\n```go\ntype ExecOptions struct {\n\tStdout   *os.File\n\tStdin    *os.File\n\tStderr   *os.File\n\tCmd      string\n\tExpectRC []int\n}\n```\n\n```go\ntype Field struct {\n\tMode     string   `json:\"mode\"`\n\tName     string   `json:\"name\"`\n\tType     string   `json:\"type\"`\n\tTitle    string   `json:\"title,omitempty\"`\n\tHelp     string   `json:\"help,omitempty\"`\n\tExample  string   `json:\"example,omitempty\"`\n\tDefault  string   `json:\"default,omitempty\"`\n\tEnum     []string `json:\"enum,omitempty\"`\n\tRequired bool     `json:\"required,omitempty\"`\n}\n```\n\n```go\ntype JSONError struct {\n\tErr string\n}\n```\n\n```go\nfunc (e JSONError) Error() string\n```\n\n```go\ntype MissingRestoreKeyError struct{}\n```\n\n```go\nfunc (e MissingRestoreKeyError) Error() string\n```\n\n```go\ntype Opt struct {\n\tHelpShort bool   `cli:\"-h\"`\n\tHelpFull  bool   `cli:\"--help\"`\n\tDebug     bool   `cli:\"-D, --debug\"     env:\"DEBUG\"`\n\tVersion   bool   `cli:\"-v, --version\"`\n\tEndpoint  string `cli:\"-e,--endpoint\"`\n\tKey       string `cli:\"-k, --key\"`\n\tText      bool   `cli:\"--text\"`\n\n\tInfo     struct{} `cli:\"info\"`\n\tValidate struct{} `cli:\"validate\"`\n\tBackup   struct{} `cli:\"backup\"`\n\tRestore  struct{} `cli:\"restore\"`\n\tStore    struct{} `cli:\"store\"`\n\tRetrieve struct{} `cli:\"retrieve\"`\n\tPurge    struct{} `cli:\"purge\"`\n}\n```\n\n```go\ntype Plugin interface {\n\tValidate(ShieldEndpoint) error\n\tBackup(ShieldEndpoint) error\n\tRestore(ShieldEndpoint) error\n\tStore(ShieldEndpoint) (string, int64, error)\n\tRetrieve(ShieldEndpoint, string) error\n\tPurge(ShieldEndpoint, string) error\n\tMeta() PluginInfo\n}\n```\n\n```go\ntype PluginFeatures struct {\n\tTarget string `json:\"target\"`\n\tStore  string `json:\"store\"`\n}\n```\n\n```go\ntype PluginInfo struct {\n\tName     string         `json:\"name\"`\n\tAuthor   string         `json:\"author\"`\n\tVersion  string         `json:\"version\"`\n\tFeatures PluginFeatures `json:\"features\"`\n\n\tExample  string `json:\"-\"`\n\tDefaults string `json:\"-\"`\n\n\tFields []Field `json:\"fields\"`\n}\n```\n\n```go\ntype ShieldEndpoint map[string]interface{}\n```\n\n```go\nfunc (endpoint ShieldEndpoint) ArrayValue(key string) ([]interface{}, error)\n```\n\n```go\nfunc (endpoint ShieldEndpoint) BooleanValue(key string) (bool, error)\n```\n\n```go\nfunc (endpoint ShieldEndpoint) BooleanValueDefault(key string, def bool) (bool, error)\n```\n\n```go\nfunc (endpoint ShieldEndpoint) FloatValue(key string) (float64, error)\n```\n\n```go\nfunc (endpoint ShieldEndpoint) FloatValueDefault(key string, def float64) (float64, error)\n```\n\n```go\nfunc (endpoint ShieldEndpoint) MapValue(key string) (map[string]interface{}, error)\n```\n\n```go\nfunc (endpoint ShieldEndpoint) StringValue(key string) (string, error)\n```\n\n```go\nfunc (endpoint ShieldEndpoint) StringValueDefault(key string, def string) (string, error)\n```\n\n```go\ntype UnsupportedActionError struct {\n\tAction string\n}\n```\n\n```go\nfunc (e UnsupportedActionError) Error() string\n```\n\n","path":"github.com/shieldproject/shield/plugin","name":"plugin","synopsis":"","isRedistributable":true}
