config

package
v0.18.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deployment

type Deployment struct {
	BotkubeConfig string
}

Deployment returns deployment with Botkube configuration

type EnvProvider

type EnvProvider struct {
}

EnvProvider environment config source provider

func NewEnvProvider

func NewEnvProvider() *EnvProvider

NewEnvProvider initializes new environment config source provider

func (*EnvProvider) Configs

func (e *EnvProvider) Configs(ctx context.Context) (YAMLFiles, error)

Configs returns list of config file locations

type FileSystemProvider

type FileSystemProvider struct {
	Files []string
}

FileSystemProvider allows consumer to pass config files statically

func NewFileSystemProvider

func NewFileSystemProvider(configs []string) *FileSystemProvider

NewFileSystemProvider initializes new static config source provider

func (*FileSystemProvider) Configs

Configs returns list of config file locations.

type Gql

type Gql struct {
	Gql    *graphql.Client
	APIURL string
}

Gql GraphQL client data structure

func NewGqlClient

func NewGqlClient(options ...Option) *Gql

NewGqlClient initializes GraphQL client

func (*Gql) GetDeployment

func (c *Gql) GetDeployment(ctx context.Context, id string) (Deployment, error)

GetDeployment retrieves deployment by id

type GqlClient

type GqlClient interface {
	GetDeployment(ctx context.Context, id string) (Deployment, error)
}

GqlClient GraphQL client

type GqlProvider

type GqlProvider struct {
	GqlClient GqlClient
}

GqlProvider is GraphQL provider

func NewGqlProvider

func NewGqlProvider(gql GqlClient) *GqlProvider

NewGqlProvider initializes new GraphQL config source provider

func (*GqlProvider) Configs

func (g *GqlProvider) Configs(ctx context.Context) (YAMLFiles, error)

Configs returns list of config files

type Option

type Option func(*Gql)

Option GraphQL client options

func WithAPIURL

func WithAPIURL(url string) Option

WithAPIURL configures ApiURL for GraphQL endpoint

type Provider

type Provider interface {
	Configs(ctx context.Context) (YAMLFiles, error)
}

Provider for configuration sources

type YAMLFiles

type YAMLFiles [][]byte

YAMLFiles denotes list of configurations in bytes

func (YAMLFiles) Merge

func (y YAMLFiles) Merge() []byte

Merge flattens 2d config bytes

Jump to

Keyboard shortcuts

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