Documentation
¶
Overview ¶
Package profile manages global human and agent profiles in the control plane.
Index ¶
- Constants
- Variables
- type BindRoleParams
- type Profile
- type RegisterParams
- type RoleBinding
- type Store
- func (s *Store) Archive(ctx context.Context, id string) (Profile, error)
- func (s *Store) ArchiveAs(ctx context.Context, id, actorID string) (Profile, error)
- func (s *Store) BindRole(ctx context.Context, params BindRoleParams) (Profile, error)
- func (s *Store) Close() error
- func (s *Store) Get(ctx context.Context, id string) (Profile, error)
- func (s *Store) List(ctx context.Context) ([]Profile, error)
- func (s *Store) Register(ctx context.Context, params RegisterParams) (Profile, error)
- func (s *Store) Update(ctx context.Context, params UpdateParams) (Profile, error)
- type UpdateParams
- type ValidationError
- type ValidationFailure
Constants ¶
View Source
const ( KindHuman = "human" KindAgent = "agent" StatusActive = "active" StatusArchived = "archived" )
Variables ¶
View Source
var ( ErrProfileNotFound = errors.New("profile not found") ErrProfileIDConflict = errors.New("profile ID already exists") ErrProfileArchived = errors.New("profile is archived") ErrContractNotFound = errors.New("contract version not found") ErrRoleNotFound = errors.New("role is not declared by the contract version") ErrRoleBindingExists = errors.New("profile role binding already exists") )
Functions ¶
This section is empty.
Types ¶
type BindRoleParams ¶
type BindRoleParams struct {
ProfileID string
ContractID string
ContractVersion int
RoleID string
Actor string
}
BindRoleParams selects one role from an immutable contract version.
type Profile ¶
type Profile struct {
ID string
Name string
Kind string
Description string
Status string
Revision int
CreatedAt time.Time
UpdatedAt time.Time
ArchivedAt *time.Time
Roles []RoleBinding
}
Profile is the current persisted profile snapshot.
type RegisterParams ¶
RegisterParams defines a new global profile.
type RoleBinding ¶
type RoleBinding struct {
ContractID string
ContractVersion int
RoleID string
RoleName string
RoleDescription string
BoundAt time.Time
}
RoleBinding is one version-scoped role attached to a profile.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store owns global profile persistence.
func (*Store) ArchiveAs ¶
ArchiveAs marks a profile archived and attributes the mutation to actorID.
func (*Store) BindRole ¶
BindRole attaches a declared contract role and advances the profile revision.
type UpdateParams ¶
UpdateParams defines a partial profile update.
type ValidationError ¶
type ValidationError struct {
Code string `json:"code"`
Path string `json:"path,omitempty"`
Message string `json:"message"`
}
ValidationError describes one invalid profile value.
type ValidationFailure ¶
type ValidationFailure struct {
Errors []ValidationError
}
ValidationFailure reports all detected profile validation errors.
func (*ValidationFailure) Error ¶
func (e *ValidationFailure) Error() string
Click to show internal directories.
Click to hide internal directories.