robot

package
v0.0.0-...-44f477e Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LEVELSYSTEM ...
	LEVELSYSTEM = "system"
	// LEVELPROJECT ...
	LEVELPROJECT = "project"

	// SCOPESYSTEM ...
	SCOPESYSTEM = "/system"
	// SCOPEPROJECT ...
	SCOPEPROJECT = "/project"
	// SCOPEALLPROJECT ...
	SCOPEALLPROJECT = "/project/*"

	// ROBOTTYPE ...
	ROBOTTYPE = "robotaccount"
)

Variables

View Source
var (
	// Ctl is a global variable for the default robot account controller implementation
	Ctl = NewController()
)

Functions

This section is empty.

Types

type Controller

type Controller interface {
	// Get ...
	Get(ctx context.Context, id int64, option *Option) (*Robot, error)

	// Count returns the total count of robots according to the query
	Count(ctx context.Context, query *q.Query) (total int64, err error)

	// Create ...
	Create(ctx context.Context, r *Robot) (int64, string, error)

	// Delete ...
	Delete(ctx context.Context, id int64) error

	// Update ...
	Update(ctx context.Context, r *Robot, option *Option) error

	// List ...
	List(ctx context.Context, query *q.Query, option *Option) ([]*Robot, error)
}

Controller to handle the requests related with robot account

func NewController

func NewController() Controller

NewController ...

type Option

type Option struct {
	WithPermission bool
}

Option ...

type Permission

type Permission struct {
	Kind      string          `json:"kind"`
	Namespace string          `json:"namespace"`
	Access    []*types.Policy `json:"access"`
	Scope     string          `json:"-"`
}

Permission ...

func (*Permission) IsCoverAll

func (p *Permission) IsCoverAll() bool

IsCoverAll ...

type Robot

type Robot struct {
	model.Robot
	ProjectName string
	Level       string
	Editable    bool          `json:"editable"`
	Permissions []*Permission `json:"permissions"`
}

Robot ...

func (*Robot) IsSysLevel

func (r *Robot) IsSysLevel() bool

IsSysLevel, true is a system level robot, others are project level.

Jump to

Keyboard shortcuts

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