action

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const AuditEntity = "action"

Variables

View Source
var (
	ErrInvalidID     = errors.New("action id is invalid")
	ErrNotExist      = errors.New("action doesn't exist")
	ErrInvalidDetail = errors.New("invalid action detail")
	ErrLogActivity   = errors.New("error while logging activity")
)
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
}

func (Action) ToLogData added in v0.6.25

func (action Action) ToLogData() LogData

type ActivityService added in v0.6.15

type ActivityService interface {
	Log(ctx context.Context, action string, actor activity.Actor, data any) error
}

type LogData added in v0.6.25

type LogData struct {
	Entity      string `mapstructure:"entity"`
	ID          string `mapstructure:"id"`
	Name        string `mapstructure:"name"`
	NamespaceID string `mapstructure:"namespace_id"`
}

type Repository

type Repository interface {
	Get(ctx context.Context, id string) (Action, error)
	Upsert(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(logger log.Logger, repository Repository, userService UserService, activityService ActivityService) *Service

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)

func (Service) Upsert added in v0.6.25

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

type UserService added in v0.6.15

type UserService interface {
	FetchCurrentUser(ctx context.Context) (user.User, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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