action

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidID     = errors.New("action id is invalid")
	ErrNotExist      = errors.New("action doesn't exist")
	ErrInvalidDetail = errors.New("invalid action detail")
)
View Source
var DefinitionCreateProject = Action{
	ID:          "create_project",
	Name:        "Create Project",
	NamespaceID: namespace.DefinitionOrg.ID,
}
View Source
var DefinitionCreateTeam = Action{
	ID:          "create_team",
	Name:        "Create Team",
	NamespaceID: namespace.DefinitionOrg.ID,
}
View Source
var DefinitionManageOrganization = Action{
	ID:          "manage_organization",
	Name:        "Manage Organization",
	NamespaceID: namespace.DefinitionOrg.ID,
}
View Source
var DefinitionManageProject = Action{
	ID:          "manage_project",
	Name:        "Manage Project",
	NamespaceID: namespace.DefinitionProject.ID,
}
View Source
var DefinitionManageTeam = Action{
	ID:          "manage_team",
	Name:        "Manage Team",
	NamespaceID: namespace.DefinitionTeam.ID,
}
View Source
var DefinitionProjectAll = Action{
	ID:          "all_actions_project",
	Name:        "All Actions Project",
	NamespaceID: namespace.DefinitionProject.ID,
}
View Source
var DefinitionTeamAll = Action{
	ID:          "all_actions_team",
	Name:        "All Actions Team",
	NamespaceID: namespace.DefinitionTeam.ID,
}
View Source
var DefinitionViewTeam = Action{
	ID:          "view_team",
	Name:        "View Team",
	NamespaceID: namespace.DefinitionTeam.ID,
}

Functions

This section is empty.

Types

type Action

type Action struct {
	ID          string
	Name        string
	NamespaceID string
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

type Repository

type Repository interface {
	Get(ctx context.Context, id string) (Action, error)
	Create(ctx context.Context, action Action) (Action, error)
	List(ctx context.Context) ([]Action, error)
	Update(ctx context.Context, action Action) (Action, error)
}

type Service

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

func NewService

func NewService(repository Repository) *Service

func (Service) Create

func (s Service) Create(ctx context.Context, action Action) (Action, error)

func (Service) Get

func (s Service) Get(ctx context.Context, id string) (Action, error)

func (Service) List

func (s Service) List(ctx context.Context) ([]Action, error)

func (Service) Update

func (s Service) Update(ctx context.Context, id string, action Action) (Action, error)

Jump to

Keyboard shortcuts

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