block

package
v0.0.0-...-756137a Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: AGPL-3.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(registry facade.FacadeRegistry)

Register is called to expose a package of facades onto a given registry.

Types

type API

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

API implements Block interface and is the concrete implementation of the api end point.

func NewAPI

func NewAPI(ctx facade.ModelContext) (*API, error)

NewAPI returns a new block API facade.

func (*API) List

func (a *API) List(ctx context.Context) (params.BlockResults, error)

List implements Block.List().

func (*API) SwitchBlockOff

func (a *API) SwitchBlockOff(ctx context.Context, args params.BlockSwitchParams) params.ErrorResult

SwitchBlockOff implements Block.SwitchBlockOff().

func (*API) SwitchBlockOn

func (a *API) SwitchBlockOn(ctx context.Context, args params.BlockSwitchParams) params.ErrorResult

SwitchBlockOn implements Block.SwitchBlockOn().

type Authorizer

type Authorizer interface {

	// HasPermission reports whether the given access is allowed for the given
	// target by the authenticated entity.
	HasPermission(ctx context.Context, operation permission.Access, target names.Tag) error
}

Authorizer defines the methods that the BlockCommandService

type BlockCommandService

type BlockCommandService interface {
	// SwitchBlockOn switches on a command block for a given type and message.
	SwitchBlockOn(ctx context.Context, t blockcommand.BlockType, message string) error
	// SwitchBlockOff disables block of specified type for the current model.
	SwitchBlockOff(ctx context.Context, t blockcommand.BlockType) error
	// GetBlocks returns all the blocks for the current model.
	GetBlocks(ctx context.Context) ([]blockcommand.Block, error)
}

BlockCommandService defines the methods that the BlockCommandService facade requires from the domain service.

Jump to

Keyboard shortcuts

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