Documentation
¶
Overview ¶
Package snaprepo contains the a set of functions to inteact with the platform repositories
Index ¶
- func Delete(params DeleteParams) error
- func Get(params GetParams) (*models.RepositoryConfig, error)
- func List(params Params) (*models.RepositoryConfigs, error)
- func Set(params SetParams) error
- type DeleteParams
- type GenericConfig
- type GetParams
- type Params
- type S3Config
- type S3TypeConfig
- type SetParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
func Get(params GetParams) (*models.RepositoryConfig, error)
Get obtains the specified snapshot repository configuration
Types ¶
type GenericConfig ¶
type GenericConfig map[string]interface{}
GenericConfig wraps a map[string]interface{} type so it implements the common.Validator interface.
func ParseGenericConfig ¶
func ParseGenericConfig(input io.Reader) (GenericConfig, error)
ParseGenericConfig reads the contents of an io.Reader and tries to parse its contents as YAML or JSON, returns an error if parsing fails in both formats.
func (GenericConfig) Validate ¶
func (c GenericConfig) Validate() error
Validate checks that the length of the map is >= 1
type S3Config ¶
type S3Config struct {
// Required settings
Region string `json:"region,omitempty"`
Bucket string `json:"bucket,omitempty"`
AccessKey string `json:"access_key,omitempty"`
SecretKey string `json:"secret_key,omitempty"`
// Optional settings
BasePath string `json:"base_path,omitempty"`
Compress bool `json:"compress,omitempty"`
ServerSideEncryption bool `json:"server_side_encryption,omitempty"`
// Advanced Settings
ChunkSize string `json:"chunk_size,omitempty"`
CannedACL string `json:"canned_acl,omitempty"`
StorageClass string `json:"storage_class,omitempty"`
// Client settings
// See http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region.
Endpoint string `json:"endpoint,omitempty"`
Protocol string `json:"protocol,omitempty"`
Timeout time.Duration `json:"timeout,omitempty"`
MaxRetries int `json:"max_retries,omitempty"`
ThrottleRetries bool `json:"throttle_retries,omitempty"`
}
S3Config is used to configure an S3 snapshot repository Full list of settings in the Elasticsearch official documentation: https://www.elastic.co/guide/en/elasticsearch/plugins/current/repository-s3-repository.html https://www.elastic.co/guide/en/elasticsearch/plugins/current/repository-s3-client.html nolint
func ParseS3Config ¶
ParseS3Config reads the contents of an io.Reader and tries to parse its contents as YAML or JSON, returns an error if parsing fails in both formats.
type S3TypeConfig ¶
S3TypeConfig is used by the text formatter to wrwap the S3 config with the type field.