tenant

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

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
	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) 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