Documentation
¶
Index ¶
- Constants
- func APITokens(ctx context.Context, teamSlug slug.Slug) (int, error)
- func CPUUsage(ctx context.Context, teamSlug slug.Slug) (float64, error)
- func MemoryUsage(ctx context.Context, teamSlug slug.Slug) (float64, error)
- func NewLoaderContext(ctx context.Context, tenantName string, ...) context.Context
- func NewWatcher(ctx context.Context, mgr *watcher.Manager) *watcher.Watcher[*UnleashInstance]
- func Toggles(ctx context.Context, teamSlug slug.Slug) (int, error)
- type AllowTeamAccessToUnleashInput
- type AllowTeamAccessToUnleashPayload
- type BifrostClient
- type CreateUnleashForTeamInput
- type CreateUnleashForTeamPayload
- type FakeBifrostClient
- type FakePrometheusClient
- type Prometheus
- type RevokeTeamAccessToUnleashInput
- type RevokeTeamAccessToUnleashPayload
- type UnleashInstance
- func AllowTeamAccess(ctx context.Context, input AllowTeamAccessToUnleashInput) (*UnleashInstance, error)
- func Create(ctx context.Context, input *CreateUnleashForTeamInput) (*UnleashInstance, error)
- func ForTeam(ctx context.Context, teamSlug slug.Slug) (*UnleashInstance, error)
- func GetByIdent(ctx context.Context, id ident.Ident) (*UnleashInstance, error)
- func RevokeTeamAccess(ctx context.Context, input RevokeTeamAccessToUnleashInput) (*UnleashInstance, error)
- func (u *UnleashInstance) DeepCopyObject() runtime.Object
- func (u *UnleashInstance) GetLabels() map[string]string
- func (u *UnleashInstance) GetName() string
- func (u *UnleashInstance) GetNamespace() string
- func (u *UnleashInstance) GetObjectKind() schema.ObjectKind
- func (u UnleashInstance) ID() ident.Ident
- func (UnleashInstance) IsNode()
- type UnleashInstanceCreatedActivityLogEntry
- type UnleashInstanceMetrics
- type UnleashInstanceUpdatedActivityLogEntry
- type UnleashInstanceUpdatedActivityLogEntryData
Constants ¶
View Source
const (
FakeBifrostURL = "*fake*"
)
View Source
const (
ManagementClusterNamespace = "bifrost-unleash"
)
Variables ¶
This section is empty.
Functions ¶
func NewLoaderContext ¶
func NewLoaderContext(ctx context.Context, tenantName string, appWatcher *watcher.Watcher[*UnleashInstance], bifrostAPIURL string, log logrus.FieldLogger) context.Context
NewLoaderContext creates a new context with a loaders value. If *fake* is provided as bifrostAPIURL, a fake client will be used.
func NewWatcher ¶
Types ¶
type AllowTeamAccessToUnleashInput ¶
type AllowTeamAccessToUnleashPayload ¶
type AllowTeamAccessToUnleashPayload struct {
Unleash *UnleashInstance `json:"unleash,omitempty"`
}
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(wtchr *watcher.Watcher[*UnleashInstance]) BifrostClient
type CreateUnleashForTeamPayload ¶
type CreateUnleashForTeamPayload struct {
Unleash *UnleashInstance `json:"unleash,omitempty"`
}
type FakeBifrostClient ¶
type FakeBifrostClient struct {
// contains filtered or unexported fields
}
func (FakeBifrostClient) WithClient ¶
func (f FakeBifrostClient) WithClient(_ *http.Client)
type FakePrometheusClient ¶
type FakePrometheusClient struct{}
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
type RevokeTeamAccessToUnleashPayload ¶
type RevokeTeamAccessToUnleashPayload struct {
Unleash *UnleashInstance `json:"unleash,omitempty"`
}
type UnleashInstance ¶
type UnleashInstance struct { Name string `json:"name"` Version string `json:"version"` WebIngress string `json:"webIngress"` APIIngress string `json:"apiIngress"` Metrics *UnleashInstanceMetrics `json:"metrics"` Ready bool `json:"ready"` TeamSlug slug.Slug `json:"-"` AllowedTeamSlugs []slug.Slug `json:"-"` }
func AllowTeamAccess ¶
func AllowTeamAccess(ctx context.Context, input AllowTeamAccessToUnleashInput) (*UnleashInstance, error)
func Create ¶
func Create(ctx context.Context, input *CreateUnleashForTeamInput) (*UnleashInstance, error)
func GetByIdent ¶
func RevokeTeamAccess ¶
func RevokeTeamAccess(ctx context.Context, input RevokeTeamAccessToUnleashInput) (*UnleashInstance, error)
func (*UnleashInstance) DeepCopyObject ¶
func (u *UnleashInstance) DeepCopyObject() runtime.Object
func (*UnleashInstance) GetLabels ¶
func (u *UnleashInstance) GetLabels() map[string]string
func (*UnleashInstance) GetName ¶
func (u *UnleashInstance) GetName() string
func (*UnleashInstance) GetNamespace ¶
func (u *UnleashInstance) GetNamespace() string
func (*UnleashInstance) GetObjectKind ¶
func (u *UnleashInstance) GetObjectKind() schema.ObjectKind
func (UnleashInstance) ID ¶
func (u UnleashInstance) ID() ident.Ident
func (UnleashInstance) IsNode ¶
func (UnleashInstance) IsNode()
type UnleashInstanceCreatedActivityLogEntry ¶
type UnleashInstanceCreatedActivityLogEntry struct {
activitylog.GenericActivityLogEntry
}
type UnleashInstanceMetrics ¶
type UnleashInstanceUpdatedActivityLogEntry ¶
type UnleashInstanceUpdatedActivityLogEntry struct { activitylog.GenericActivityLogEntry Data *UnleashInstanceUpdatedActivityLogEntryData `json:"data"` }
Click to show internal directories.
Click to hide internal directories.