shalm

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2020 License: Apache-2.0 Imports: 54 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProxyModeOff -
	ProxyModeOff = iota
	// ProxyModeLocal -
	ProxyModeLocal
	// ProxyModeRemote -
	ProxyModeRemote
)
View Source
const (
	// ToolKubectl -
	ToolKubectl = iota
	// ToolKapp -
	ToolKapp
)

Variables

This section is empty.

Functions

func DockerTag

func DockerTag() string

DockerTag -

func NewChartFunction

func NewChartFunction(repo Repo, dir string, namespace string, suffix string) func(thread *starlark.Thread, fn *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (value starlark.Value, e error)

NewChartFunction -

func NewVault

func NewVault(backend VaultBackend, name string) (starlark.Value, error)

NewVault -

func Version

func Version() string

Version -

Types

type CancelObjectStream added in v0.2.5

type CancelObjectStream struct{}

CancelObjectStream -

func (CancelObjectStream) Error added in v0.2.5

func (c CancelObjectStream) Error() string

type Chart

type Chart interface {
	GetName() string
	GetVersion() semver.Version
	Apply(thread *starlark.Thread, k K8s) error
	Delete(thread *starlark.Thread, k K8s) error
	Template(thread *starlark.Thread) Stream
	Package(writer io.Writer, helmFormat bool) error
}

Chart -

type ChartOption

type ChartOption func(options *ChartOptions)

ChartOption -

func WithArgs

func WithArgs(args starlark.Tuple) ChartOption

WithArgs -

func WithKwArgs

func WithKwArgs(kwargs []starlark.Tuple) ChartOption

WithKwArgs -

func WithNamespace

func WithNamespace(namespace string) ChartOption

WithNamespace -

func WithProxy

func WithProxy(proxy ProxyMode) ChartOption

WithProxy -

func WithSuffix

func WithSuffix(suffix string) ChartOption

WithSuffix -

type ChartOptions

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

ChartOptions -

func (*ChartOptions) AddFlags

func (v *ChartOptions) AddFlags(flagsSet *pflag.FlagSet)

AddFlags -

func (*ChartOptions) Merge

func (v *ChartOptions) Merge() ChartOption

Merge -

type ChartValue

type ChartValue interface {
	starlark.HasSetField
	Chart
}

ChartValue -

type ComplexVaultBackend

type ComplexVaultBackend interface {
	VaultBackend
	Template() (map[string][]byte, error)
	Delete() error
}

ComplexVaultBackend -

type DirCache added in v0.4.3

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

DirCache -

func NewDirCache added in v0.4.3

func NewDirCache(baseDir string) *DirCache

NewDirCache -

func (*DirCache) WrapDir added in v0.4.3

func (d *DirCache) WrapDir(load LoadDir) OpenDirCache

WrapDir -

func (*DirCache) WrapReader added in v0.4.3

func (d *DirCache) WrapReader(load LoadReader) OpenReaderCache

WrapReader -

type K8s

type K8s interface {
	K8sReader
	ForSubChart(namespace string, app string, version semver.Version) K8s
	Inspect() string
	Watch(kind string, name string, options *K8sOptions) ObjectStream
	RolloutStatus(kind string, name string, options *K8sOptions) error
	Wait(kind string, name string, condition string, options *K8sOptions) error
	DeleteObject(kind string, name string, options *K8sOptions) error
	Apply(output ObjectStream, options *K8sOptions) error
	Delete(output ObjectStream, options *K8sOptions) error
	ConfigContent() *string
	ForConfig(config string) (K8s, error)
	Progress(progress int)
	Tool() Tool
}

K8s kubernetes API

func NewK8s

func NewK8s(configs ...K8sConfig) (K8s, error)

NewK8s create new instance to interact with kubernetes

type K8sConfig

type K8sConfig func(options *K8sConfigs) error

K8sConfig -

func WithKubeConfigContent

func WithKubeConfigContent(value string) K8sConfig

WithKubeConfigContent -

func WithProgressSubscription

func WithProgressSubscription(value ProgressSubscription) K8sConfig

WithProgressSubscription -

func WithTool

func WithTool(value Tool) K8sConfig

WithTool -

type K8sConfigs

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

K8sConfigs -

func (*K8sConfigs) AddFlags

func (v *K8sConfigs) AddFlags(flagsSet *pflag.FlagSet)

AddFlags -

func (*K8sConfigs) Merge

func (v *K8sConfigs) Merge() K8sConfig

Merge -

func (*K8sConfigs) Progress

func (v *K8sConfigs) Progress(progress int)

Progress -

func (*K8sConfigs) Tool

func (v *K8sConfigs) Tool() Tool

Tool -

type K8sInMemory

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

K8sInMemory in memory implementation of K8s

func NewK8sInMemory

func NewK8sInMemory(namespace string, objects ...Object) *K8sInMemory

NewK8sInMemory creates a new K8sInMemory instance

func (K8sInMemory) Apply

func (k K8sInMemory) Apply(output ObjectStream, options *K8sOptions) error

Apply -

func (K8sInMemory) ConfigContent

func (k K8sInMemory) ConfigContent() *string

ConfigContent -

func (K8sInMemory) Delete

func (k K8sInMemory) Delete(output ObjectStream, options *K8sOptions) error

Delete -

func (K8sInMemory) DeleteObject

func (k K8sInMemory) DeleteObject(kind string, name string, options *K8sOptions) error

DeleteObject -

func (K8sInMemory) ForConfig

func (k K8sInMemory) ForConfig(config string) (K8s, error)

ForConfig -

func (K8sInMemory) ForSubChart

func (k K8sInMemory) ForSubChart(namespace string, app string, version semver.Version) K8s

ForSubChart -

func (K8sInMemory) Get

func (k K8sInMemory) Get(kind string, name string, options *K8sOptions) (*Object, error)

Get -

func (K8sInMemory) GetObject

func (k K8sInMemory) GetObject(kind string, name string) (*Object, error)

GetObject -

func (K8sInMemory) Inspect

func (k K8sInMemory) Inspect() string

Inspect -

func (K8sInMemory) IsNotExist

func (k K8sInMemory) IsNotExist(err error) bool

IsNotExist -

func (K8sInMemory) Progress

func (k K8sInMemory) Progress(progress int)

Progress -

func (K8sInMemory) RolloutStatus

func (k K8sInMemory) RolloutStatus(kind string, name string, options *K8sOptions) error

RolloutStatus -

func (K8sInMemory) Tool

func (k K8sInMemory) Tool() Tool

Tool -

func (K8sInMemory) Wait

func (k K8sInMemory) Wait(kind string, name string, condition string, options *K8sOptions) error

Wait -

func (K8sInMemory) Watch

func (k K8sInMemory) Watch(kind string, name string, options *K8sOptions) ObjectStream

Watch -

type K8sOptions

type K8sOptions struct {
	Namespaced     bool
	Namespace      string
	Timeout        time.Duration
	IgnoreNotFound bool
}

K8sOptions common options for calls to k8s

type K8sReader

type K8sReader interface {
	Get(kind string, name string, options *K8sOptions) (*Object, error)
	IsNotExist(err error) bool
}

K8sReader kubernetes reader API

type K8sValue

type K8sValue interface {
	starlark.Value
	K8s
}

K8sValue -

func NewK8sValue

func NewK8sValue(k K8s) K8sValue

NewK8sValue create new instance to interact with kubernetes

type KwArgsFileVar added in v0.2.5

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

KwArgsFileVar -

func (*KwArgsFileVar) Set added in v0.2.5

func (p *KwArgsFileVar) Set(val string) error

Set -

func (KwArgsFileVar) String added in v0.2.5

func (p KwArgsFileVar) String() string

func (KwArgsFileVar) Type added in v0.2.5

func (p KwArgsFileVar) Type() string

Type -

type KwArgsVar added in v0.2.5

type KwArgsVar []starlark.Tuple

KwArgsVar -

func (*KwArgsVar) Set added in v0.2.5

func (p *KwArgsVar) Set(val string) error

Set -

func (KwArgsVar) String added in v0.2.5

func (p KwArgsVar) String() string

func (KwArgsVar) Type added in v0.2.5

func (p KwArgsVar) Type() string

Type -

type KwArgsYamlVar added in v0.2.5

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

KwArgsYamlVar -

func (*KwArgsYamlVar) Set added in v0.2.5

func (p *KwArgsYamlVar) Set(val string) error

Set -

func (KwArgsYamlVar) String added in v0.2.5

func (p KwArgsYamlVar) String() string

func (KwArgsYamlVar) Type added in v0.2.5

func (p KwArgsYamlVar) Type() string

Type -

type LoadDir added in v0.4.3

type LoadDir = func(name string, targetDir func() (string, error), etagOld string) (etagNew string, err error)

LoadDir -

type LoadReader added in v0.4.3

type LoadReader = func(name string, etagOld string) (reader io.ReadCloser, etagNew string, err error)

LoadReader -

type MetaData

type MetaData struct {
	Namespace  string
	Name       string
	Labels     map[string]string
	Additional map[string]json.RawMessage
}

MetaData -

func (MetaData) MarshalJSON added in v0.2.5

func (m MetaData) MarshalJSON() ([]byte, error)

MarshalJSON -

func (*MetaData) UnmarshalJSON added in v0.2.5

func (m *MetaData) UnmarshalJSON(b []byte) error

UnmarshalJSON -

type Object

type Object struct {
	MetaData   MetaData                   `json:"metadata,omitempty"`
	APIVersion string                     `json:"apiVersion,omitempty"`
	Kind       string                     `json:"kind,omitempty"`
	Additional map[string]json.RawMessage `json:",inline"`
}

Object -

func (Object) MarshalJSON added in v0.2.5

func (o Object) MarshalJSON() ([]byte, error)

MarshalJSON -

func (*Object) UnmarshalJSON added in v0.2.5

func (o *Object) UnmarshalJSON(b []byte) error

UnmarshalJSON -

type ObjectStream

type ObjectStream func(w ObjectWriter) error

ObjectStream -

func ObjectErrorStream added in v0.2.5

func ObjectErrorStream(err error) ObjectStream

ObjectErrorStream -

func (ObjectStream) Encode

func (o ObjectStream) Encode() Stream

Encode -

func (ObjectStream) Filter added in v0.2.5

func (o ObjectStream) Filter(filter func(obj *Object) bool) ObjectStream

Filter -

func (ObjectStream) GroupBy added in v0.2.5

func (o ObjectStream) GroupBy(group func(o *Object) string) func(key string) ObjectStream

GroupBy -

func (ObjectStream) Map

func (o ObjectStream) Map(f func(obj *Object) *Object) ObjectStream

Map -

func (ObjectStream) Sort

func (o ObjectStream) Sort(f func(o1 *Object, o2 *Object) int, reverse bool) ObjectStream

Sort -

type ObjectWriter

type ObjectWriter = func(obj *Object) error

ObjectWriter -

type OpenDirCache added in v0.4.3

type OpenDirCache = func(name string) (cachedDir string, err error)

OpenDirCache -

type OpenReaderCache added in v0.4.3

type OpenReaderCache = func(name string) (io.ReadCloser, error)

OpenReaderCache -

type ProgressSubscription

type ProgressSubscription = func(progress int)

ProgressSubscription -

type ProxyMode

type ProxyMode int

ProxyMode -

func (*ProxyMode) Set

func (p *ProxyMode) Set(val string) error

Set -

func (ProxyMode) String

func (p ProxyMode) String() string

func (*ProxyMode) Type

func (p *ProxyMode) Type() string

Type -

type Repo

type Repo interface {
	// Get -
	Get(thread *starlark.Thread, url string, options ...ChartOption) (ChartValue, error)
	// GetFromSpec -
	GetFromSpec(thread *starlark.Thread, spec *shalmv1a2.ChartSpec) (ChartValue, error)
}

Repo -

func NewRepo

func NewRepo(config ...RepoConfig) (Repo, error)

NewRepo -

type RepoConfig added in v0.4.3

type RepoConfig func(r *repoConfigs) error

RepoConfig -

func WithBasicAuth added in v0.4.3

func WithBasicAuth(url string, username string, password string) RepoConfig

WithBasicAuth -

func WithConfigFile added in v0.4.3

func WithConfigFile(filename string) RepoConfig

WithConfigFile -

func WithTokenAuth added in v0.4.3

func WithTokenAuth(url string, token string) RepoConfig

WithTokenAuth -

type Stream

type Stream = func(io.Writer) error

Stream -

func ErrorStream

func ErrorStream(err error) Stream

ErrorStream -

type Tool

type Tool int

Tool -

func (*Tool) Set

func (t *Tool) Set(val string) error

Set -

func (Tool) String

func (t Tool) String() string

func (*Tool) Type

func (t *Tool) Type() string

Type -

type VaultBackend

type VaultBackend interface {
	Name() string
	Keys() map[string]string
	Apply(map[string][]byte) (map[string][]byte, error)
}

VaultBackend -

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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