object

package
v0.61.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ResourceTypeRole = "role"

Variables

This section is empty.

Functions

This section is empty.

Types

type RoleListParamParser

type RoleListParamParser struct{}

func (RoleListParamParser) GetDefaultSortBy

func (parser RoleListParamParser) GetDefaultSortBy() string

func (RoleListParamParser) GetSupportedSortBys

func (parser RoleListParamParser) GetSupportedSortBys() []string

func (RoleListParamParser) ParseValue

func (parser RoleListParamParser) ParseValue(val string, sortBy string) (interface{}, error)

type RoleService

type RoleService struct {
	service.BaseService
	EventSvc  event.Service
	ObjectSvc object.Service
}

func NewService

func NewService(env service.Env, eventSvc event.Service, objectSvc object.Service) *RoleService

func (RoleService) Create

func (svc RoleService) Create(ctx context.Context, roleSpec RoleSpec) (*RoleSpec, error)

func (RoleService) DeleteByRoleId

func (svc RoleService) DeleteByRoleId(ctx context.Context, roleId string) error

func (RoleService) GetByRoleId

func (svc RoleService) GetByRoleId(ctx context.Context, roleId string) (*RoleSpec, error)

func (RoleService) List

func (svc RoleService) List(ctx context.Context, listParams service.ListParams) ([]RoleSpec, error)

func (RoleService) Routes

func (svc RoleService) Routes() ([]service.Route, error)

func (RoleService) UpdateByRoleId

func (svc RoleService) UpdateByRoleId(ctx context.Context, roleId string, roleSpec UpdateRoleSpec) (*RoleSpec, error)

type RoleSpec

type RoleSpec struct {
	RoleId      string    `json:"roleId"      validate:"required,valid_object_id"`
	Name        *string   `json:"name"`
	Description *string   `json:"description"`
	CreatedAt   time.Time `json:"createdAt"`
}

func NewRoleSpecFromObjectSpec

func NewRoleSpecFromObjectSpec(objectSpec *object.ObjectSpec) (*RoleSpec, error)

func (RoleSpec) ToCreateObjectSpec

func (spec RoleSpec) ToCreateObjectSpec() (*object.CreateObjectSpec, error)

type UpdateRoleSpec

type UpdateRoleSpec struct {
	Name        *string `json:"name"`
	Description *string `json:"description"`
}

func (UpdateRoleSpec) ToUpdateObjectSpec

func (updateSpec UpdateRoleSpec) ToUpdateObjectSpec() *object.UpdateObjectSpec

Jump to

Keyboard shortcuts

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