immutable

package
v0.0.0-...-a14a4d2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Ctr is a global variable for the default immutable controller implementation
	Ctr = NewAPIController(immutable.NewDefaultRuleManager())
)

Functions

This section is empty.

Types

type Controller

type Controller interface {
	// GetImmutableRule ...
	GetImmutableRule(ctx context.Context, id int64) (*model.Metadata, error)

	// CreateImmutableRule ...
	CreateImmutableRule(ctx context.Context, m *model.Metadata) (int64, error)

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

	// UpdateImmutableRule ...
	UpdateImmutableRule(ctx context.Context, projectID int64, m *model.Metadata) error

	// ListImmutableRules ...
	ListImmutableRules(ctx context.Context, query *q.Query) ([]*model.Metadata, error)

	// Count count the immutable rules
	Count(ctx context.Context, query *q.Query) (int64, error)

	// DeleteImmutableRuleByProject delete immuatable rules with project id
	DeleteImmutableRuleByProject(ctx context.Context, projectID int64) error
}

Controller to handle the requests related with immutable

func NewAPIController

func NewAPIController(immutableMgr immutable.Manager) Controller

NewAPIController ...

type DefaultAPIController

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

DefaultAPIController ...

func (*DefaultAPIController) Count

func (r *DefaultAPIController) Count(ctx context.Context, query *q.Query) (int64, error)

Count count the immutable rules

func (*DefaultAPIController) CreateImmutableRule

func (r *DefaultAPIController) CreateImmutableRule(ctx context.Context, m *model.Metadata) (int64, error)

CreateImmutableRule ...

func (*DefaultAPIController) DeleteImmutableRule

func (r *DefaultAPIController) DeleteImmutableRule(ctx context.Context, id int64) error

DeleteImmutableRule ...

func (*DefaultAPIController) DeleteImmutableRuleByProject

func (r *DefaultAPIController) DeleteImmutableRuleByProject(ctx context.Context, projectID int64) error

func (*DefaultAPIController) GetImmutableRule

func (r *DefaultAPIController) GetImmutableRule(ctx context.Context, id int64) (*model.Metadata, error)

GetImmutableRule ...

func (*DefaultAPIController) ListImmutableRules

func (r *DefaultAPIController) ListImmutableRules(ctx context.Context, query *q.Query) ([]*model.Metadata, error)

ListImmutableRules ...

func (*DefaultAPIController) UpdateImmutableRule

func (r *DefaultAPIController) UpdateImmutableRule(ctx context.Context, projectID int64, m *model.Metadata) error

UpdateImmutableRule ...

Jump to

Keyboard shortcuts

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