tenant

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APP_ID_REGEX = `^[a-zA-Z0-9][a-zA-Z0-9_\-]*[a-zA-Z0-9]$`
	ORG_ID_REGEX = `^[a-zA-Z0-9][a-zA-Z0-9_\-]*[a-zA-Z0-9]$`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BadConfigError

type BadConfigError struct {
}

func (*BadConfigError) Error

func (e *BadConfigError) Error() string

type Config

type Config struct {
	Tenant       Id       `json:"tenant"`                 // tenant id
	Quota        Quota    `json:"quota"`                  // tenant quota
	ClientIds    []string `json:"clientIds,omitempty"`    // jwt subjects or client IDs
	ClientSecret string   `json:"clientSecret"`           // client secret for first client id in list, needed to make calls to credentials API
	OpenEventApi bool     `json:"openEventApi,omitempty"` // if true, allow unauthenticated calls to the event API for routes under that tenant
	Modified     int64    `json:"modified,omitempty"`     // last time when the tenant config is modified
}

type Id

type Id struct {
	OrgId string `json:"orgId,omitempty"`
	AppId string `json:"appId,omitempty"`
}

func (Id) Equal

func (id Id) Equal(tid Id) bool

func (Id) Key

func (id Id) Key() string

Key A string representation of tenant id that can be used has a key for certain data structure like a map

func (Id) KeyWithFragment added in v0.9.0

func (id Id) KeyWithFragment(fragmentId string) string

func (Id) KeyWithRoute

func (id Id) KeyWithRoute(routeId string) string

KeyWithRoute A string representation of tenant id + route id that can be used has a key for certain data structure like a map

func (Id) ToString

func (id Id) ToString() string

type InternalStorageError

type InternalStorageError struct {
	Wrapped error
}

func (*InternalStorageError) Error

func (e *InternalStorageError) Error() string

func (*InternalStorageError) Unwrap

func (e *InternalStorageError) Unwrap() error

type Quota

type Quota struct {
	EventsPerSec int `json:"eventsPerSec"`
}

type TenantNotFoundError

type TenantNotFoundError struct {
	Tenant Id
}

func (*TenantNotFoundError) Error

func (e *TenantNotFoundError) Error() string

type TenantStorer

type TenantStorer interface {
	GetAllConfigs(ctx context.Context) ([]Config, error)
	GetConfig(ctx context.Context, id Id) (*Config, error)
	SetConfig(ctx context.Context, config Config) error
	DeleteConfig(ctx context.Context, id Id) error
}

Jump to

Keyboard shortcuts

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