blob

package
v0.6.21 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	Name      string     `yaml:"name"`
	Target    string     `yaml:"target"`
	Methods   []string   `yaml:"methods"`
	Frontends []Frontend `yaml:"frontends"`
	Prefix    string     `yaml:"prefix"`
}

type Bucket

type Bucket interface {
	WriteAll(ctx context.Context, key string, p []byte, opts *blob.WriterOptions) error
	ReadAll(ctx context.Context, key string) ([]byte, error)
	List(opts *blob.ListOptions) *blob.ListIterator
	Delete(ctx context.Context, key string) error
	Close() error
}

func NewStore

func NewStore(ctx context.Context, storagePath, storageSecret string) (Bucket, error)

type Config

type Config struct {
	Type string `yaml:"type" json:"type"`

	ResourceTypes []ResourceTypeConfig `yaml:"resource_types" json:"resource_types,omitempty"`

	Roles       []RoleConfig        `yaml:"roles" json:"roles,omitempty"`
	Permissions []PermissionsConfig `yaml:"permissions" json:"permissions,omitempty"`
}

type Frontend

type Frontend struct {
	Action      string       `yaml:"action"`
	Path        string       `yaml:"path"`
	Method      string       `yaml:"method"`
	Middlewares []Middleware `yaml:"middlewares"`
	Hooks       []Hook       `yaml:"hooks"`
}

type Hook

type Hook struct {
	Name   string                 `yaml:"name"`
	Config map[string]interface{} `yaml:"config"`
}

type Middleware

type Middleware struct {
	Name   string                 `yaml:"name"`
	Config map[string]interface{} `yaml:"config"`
}

type PermissionsConfig

type PermissionsConfig struct {
	Name  string   `yaml:"name" json:"name"`
	Roles []string `yaml:"roles" json:"roles"`
}

type Resource

type Resource struct {
	Name    string
	Actions map[string][]string
}

type ResourceBackend

type ResourceBackend struct {
	Name          string         `json:"name" yaml:"name"`
	ResourceTypes []ResourceType `json:"resource_types" yaml:"resource_types"`
}

type ResourceBackends

type ResourceBackends struct {
	Backends []ResourceBackend `json:"backends" yaml:"backends"`
}

type ResourceType

type ResourceType struct {
	Name    string              `json:"name" yaml:"name"`
	Actions map[string][]string `json:"actions" yaml:"actions"`
}

type ResourceTypeConfig

type ResourceTypeConfig struct {
	Name        string              `yaml:"name" json:"name"`
	Roles       []RoleConfig        `yaml:"roles" json:"roles"`
	Permissions []PermissionsConfig `yaml:"permissions" json:"permissions"`
}

type Resources

type Resources struct {
	Resources []Resource
}

type ResourcesRepository

type ResourcesRepository struct {
	Bucket Bucket
	// contains filtered or unexported fields
}

func NewResourcesRepository

func NewResourcesRepository(logger log.Logger, b Bucket) *ResourcesRepository

func (*ResourcesRepository) Close

func (repo *ResourcesRepository) Close() error

func (*ResourcesRepository) GetAll

func (repo *ResourcesRepository) GetAll(ctx context.Context) ([]resource.YAML, error)

func (*ResourcesRepository) GetRelationsForNamespace

func (repo *ResourcesRepository) GetRelationsForNamespace(ctx context.Context, namespaceID string) (map[string]bool, error)

func (*ResourcesRepository) InitCache

func (repo *ResourcesRepository) InitCache(ctx context.Context, refreshDelay time.Duration) error

type RoleConfig

type RoleConfig struct {
	Name       string   `yaml:"name" json:"name"`
	Principals []string `yaml:"principals" json:"principals"`
}

type Rule

type Rule struct {
	Backends []Backend `yaml:"backends"`
}

type RuleRepository

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

func NewRuleRepository

func NewRuleRepository(logger log.Logger, b Bucket) *RuleRepository

func (*RuleRepository) Close

func (repo *RuleRepository) Close() error

func (*RuleRepository) GetAll

func (repo *RuleRepository) GetAll(ctx context.Context) ([]rule.Ruleset, error)

func (*RuleRepository) InitCache

func (repo *RuleRepository) InitCache(ctx context.Context, refreshDelay time.Duration) error

type Ruleset

type Ruleset struct {
	Rules []Rule `yaml:"rules"`
}

type SchemaConfig

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

func NewSchemaConfigRepository

func NewSchemaConfigRepository(b Bucket) *SchemaConfig

func (*SchemaConfig) GetSchema

Jump to

Keyboard shortcuts

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