unleash

package
v0.0.0-...-7a56977 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ManagementClusterNamespace = "bifrost-unleash"
)
View Source
const PrometheusUrl = "https://nais-prometheus.%s.cloud.nais.io"
View Source
const (
	UnleashTeamsEnvVar = "TEAMS_ALLOWED_TEAMS"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BifrostClient

type BifrostClient interface {
	Post(ctx context.Context, path string, v any) (*http.Response, error)
	WithClient(client *http.Client)
}

func NewBifrostClient

func NewBifrostClient(url string, log logrus.FieldLogger) BifrostClient

func NewFakeBifrostClient

func NewFakeBifrostClient(k8sClient dynamic.Interface) BifrostClient

type Config

type Config struct {
	Enabled       bool
	Namespace     string
	BifrostApiUrl string
}

type FakeBifrostClient

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

func (FakeBifrostClient) Post

func (f FakeBifrostClient) Post(ctx context.Context, path string, v any) (*http.Response, error)

func (FakeBifrostClient) WithClient

func (f FakeBifrostClient) WithClient(_ *http.Client)

type FakePrometheusClient

type FakePrometheusClient struct{}

func (FakePrometheusClient) Query

type Manager

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

func NewManager

func NewManager(tenant string, clusters []string, config Config, log logrus.FieldLogger, opts ...Opt) (*Manager, error)

func (*Manager) NewUnleash

func (m *Manager) NewUnleash(ctx context.Context, name string, allowedTeams []string) (*model.Unleash, error)

func (*Manager) PromQuery

func (m *Manager) PromQuery(ctx context.Context, q string) (model.SampleValue, error)

func (Manager) Start

func (m Manager) Start(ctx context.Context, log logrus.FieldLogger) error

func (*Manager) Unleash

func (m *Manager) Unleash(team string) (*model.Unleash, error)

func (*Manager) UpdateUnleash

func (m *Manager) UpdateUnleash(ctx context.Context, name string, allowedTeams []string) (*model.Unleash, error)

type Opt

type Opt func(*settings)

func WithClientsCreator

func WithClientsCreator(f func(cluster string) (kubernetes.Interface, dynamic.Interface, error)) Opt

type Prometheus

type Prometheus interface {
	Query(ctx context.Context, query string, ts time.Time, opts ...prom.Option) (model.Value, prom.Warnings, error)
}

func NewFakePrometheusClient

func NewFakePrometheusClient() Prometheus

Jump to

Keyboard shortcuts

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