loader

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package loader implements a generic way to load / generate kubeconfig files from different sources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackendConfig

type BackendConfig interface {
	Yaml(unsafe bool) ([]byte, error) // returns the sanitized loader config as yaml
	Sanitize() BackendConfig          // returns the sanitized loader config
}

type FileBackend

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

func NewFileBackend

func NewFileBackend(path string, decryptKey string) *FileBackend

func NewFileBackendFromConfig

func NewFileBackendFromConfig(config *FileConfig) *FileBackend

func NewFileBackendFromParams

func NewFileBackendFromParams(params map[string]interface{}) (*FileBackend, error)

func (*FileBackend) Config

func (b *FileBackend) Config() BackendConfig

func (*FileBackend) Load

func (b *FileBackend) Load() ([]byte, error)

func (*FileBackend) Type

func (b *FileBackend) Type() string

type FileConfig

type FileConfig struct {
	Path       string `json:"path"`
	DecryptKey string `json:"decrypt_key"`
}

func (*FileConfig) Sanitize

func (c *FileConfig) Sanitize() BackendConfig

func (*FileConfig) Yaml

func (c *FileConfig) Yaml(unsafe bool) ([]byte, error)

type Loader

type Loader interface {
	Load() ([]byte, error) // loads the config from the source
	Type() string          // returns the loader backend type
	Config() BackendConfig // returns the backend config of the loader
}

Loader defines the loader interface

func New

func New(backend string, params map[string]interface{}) (Loader, error)

type S3Backend

type S3Backend struct {
	Downloader s3manageriface.DownloaderAPI
	// contains filtered or unexported fields
}

func NewS3Backend

func NewS3Backend(accessKey string, secretKey string, region string, server string, decryptKey string, bucket string, path string) (*S3Backend, error)

func NewS3BackendFromConfig

func NewS3BackendFromConfig(config *S3Config) (*S3Backend, error)

func NewS3BackendFromParams

func NewS3BackendFromParams(params map[string]interface{}) (*S3Backend, error)

func (*S3Backend) Config

func (b *S3Backend) Config() BackendConfig

func (*S3Backend) Load

func (b *S3Backend) Load() ([]byte, error)

func (*S3Backend) Type

func (b *S3Backend) Type() string

type S3Config

type S3Config struct {
	AccessKey  string `json:"accesskey"`
	SecretKey  string `json:"secretkey"`
	Region     string `json:"region"`
	Server     string `json:"server"`
	DecryptKey string `json:"decrypt_key"`
	Bucket     string `json:"bucket"`
	Path       string `json:"path"`
}

func (*S3Config) Sanitize

func (c *S3Config) Sanitize() BackendConfig

func (*S3Config) Yaml

func (c *S3Config) Yaml(unsafe bool) ([]byte, error)

Jump to

Keyboard shortcuts

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