Documentation
¶
Index ¶
- Constants
- func GetNewNicState(current *apiv2.NicState, status apiv2.SwitchPortStatus) (*apiv2.NicState, bool)
- func NewTenantCreateOptWithCreator(creator string) *tenantCreateOptWithCreator
- func TenantRoleFromMap(annotations map[string]string) apiv2.TenantRole
- type Config
- type CreateMessage
- type Entity
- type FilesystemLayout
- type IP
- type Image
- type Machine
- type Message
- type Network
- type Partition
- type Project
- type ProjectMember
- type ProjectMemberCreateRequest
- type ProjectMemberQuery
- type ProjectMemberUpdateRequest
- type ProjectScope
- type ProjectsAndTenants
- type Query
- type Repo
- type Repository
- type Size
- type Store
- func (s *Store) FilesystemLayout() FilesystemLayout
- func (s *Store) IP(project string) IP
- func (s *Store) Image() Image
- func (r *Store) IpDeleteHandleFn(ctx context.Context, t *asynq.Task) error
- func (s *Store) Machine(project string) Machine
- func (r *Store) MachineBMCCommandHandleFn(ctx context.Context, t *asynq.Task) error
- func (r *Store) MachineDeleteHandleFn(ctx context.Context, t *asynq.Task) error
- func (s *Store) Network(project string) Network
- func (r *Store) NetworkDeleteHandleFn(ctx context.Context, t *asynq.Task) error
- func (s *Store) Partition() Partition
- func (s *Store) Project(project string) Project
- func (s *Store) Size() Size
- func (s *Store) Switch() Switch
- func (s *Store) Task() *task.Client
- func (s *Store) Tenant() Tenant
- func (s *Store) UnscopedIP() IP
- func (s *Store) UnscopedMachine() Machine
- func (s *Store) UnscopedNetwork() Network
- func (s *Store) UnscopedProject() Project
- type Switch
- type SwitchServiceCreateRequest
- type SwitchStatus
- type Tenant
- type TenantMember
- type TenantMemberCreateRequest
- type TenantMemberQuery
- type TenantMemberUpdateRequest
- type TenantScope
- type TenantWithMembershipAnnotations
- type UpdateMessage
Constants ¶
const ( // TODO: Migrate to common fields introduced in https://github.com/metal-stack/masterdata-api/pull/127 TenantTagEmail = "metal-stack.io/email" TenantTagAvatarURL = "metal-stack.io/avatarurl" TenantTagCreator = "metal-stack.io/creator" // TODO: Use scoped memberships: https://github.com/metal-stack/masterdata-api/issues/130 TenantRoleAnnotation = "metal-stack.io/tenant-role" )
const (
ProjectRoleAnnotation = "metal-stack.io/project-role"
)
Variables ¶
This section is empty.
Functions ¶
func GetNewNicState ¶ added in v0.1.0
func NewTenantCreateOptWithCreator ¶ added in v0.0.7
func NewTenantCreateOptWithCreator(creator string) *tenantCreateOptWithCreator
func TenantRoleFromMap ¶ added in v0.0.6
func TenantRoleFromMap(annotations map[string]string) apiv2.TenantRole
Types ¶
type CreateMessage ¶
type CreateMessage any
CreateMessage is an external request to create an entity for consumers. TODO: ideally all update messages should clearly expose the identifier in order to get the entity with it! UpdateMessage interface{ ID() string }
type Entity ¶
Entity is the internal representation of an api resource, which is stored in the backend.
type FilesystemLayout ¶
type FilesystemLayout interface {
Repository[*filesystemLayoutRepository, *apiv2.FilesystemLayout, *adminv2.FilesystemServiceCreateRequest, *adminv2.FilesystemServiceUpdateRequest, *apiv2.FilesystemServiceListRequest]
}
type IP ¶
type IP interface {
Repository[*ipRepository, *apiv2.IP, *apiv2.IPServiceCreateRequest, *apiv2.IPServiceUpdateRequest, *apiv2.IPQuery]
}
type Image ¶
type Image interface {
Repository[*imageRepository, *apiv2.Image, *adminv2.ImageServiceCreateRequest, *adminv2.ImageServiceUpdateRequest, *apiv2.ImageQuery]
}
type Machine ¶ added in v0.0.6
type Machine interface {
Repository[*machineRepository, *apiv2.Machine, *apiv2.MachineServiceCreateRequest, *apiv2.MachineServiceUpdateRequest, *apiv2.MachineQuery]
}
type Message ¶
type Message any
Message is the external representation of an api resource for consumers.
type Network ¶
type Network interface {
Repository[*networkRepository, *apiv2.Network, *adminv2.NetworkServiceCreateRequest, *adminv2.NetworkServiceUpdateRequest, *apiv2.NetworkQuery]
}
type Partition ¶
type Partition interface {
Repository[*partitionRepository, *apiv2.Partition, *adminv2.PartitionServiceCreateRequest, *adminv2.PartitionServiceUpdateRequest, *apiv2.PartitionQuery]
}
type Project ¶
type Project interface {
Repository[*projectRepository, *apiv2.Project, *apiv2.ProjectServiceCreateRequest, *apiv2.ProjectServiceUpdateRequest, *apiv2.ProjectServiceListRequest]
}
type ProjectMember ¶ added in v0.0.6
type ProjectMember interface {
Repository[*projectMemberRepository, *apiv2.ProjectMember, *ProjectMemberCreateRequest, *ProjectMemberUpdateRequest, *ProjectMemberQuery]
}
type ProjectMemberCreateRequest ¶ added in v0.0.6
type ProjectMemberCreateRequest struct {
TenantId string
Role apiv2.ProjectRole
}
type ProjectMemberQuery ¶ added in v0.0.6
type ProjectMemberUpdateRequest ¶ added in v0.0.6
type ProjectMemberUpdateRequest struct {
Role apiv2.ProjectRole
Meta apiv2.Meta
}
func (*ProjectMemberUpdateRequest) GetUpdateMeta ¶ added in v0.0.8
func (*ProjectMemberUpdateRequest) GetUpdateMeta() *apiv2.UpdateMeta
type ProjectScope ¶
type ProjectScope struct {
// contains filtered or unexported fields
}
type ProjectsAndTenants ¶ added in v0.0.6
type Repo ¶ added in v0.0.4
type Repo any
Repo is the typed repository in order to expose public functions on the repository to the consumers.
type Repository ¶
type Repository[R Repo, M Message, C CreateMessage, U UpdateMessage, Q Query] interface {
Get(ctx context.Context, id string) (M, error)
Create(ctx context.Context, c C) (M, error)
Update(ctx context.Context, id string, u U) (M, error)
Delete(ctx context.Context, id string) (M, error)
Find(ctx context.Context, query Q) (M, error)
List(ctx context.Context, query Q) ([]M, error)
AdditionalMethods() R
}
type Size ¶ added in v0.0.5
type Size interface {
Repository[*sizeRepository, *apiv2.Size, *adminv2.SizeServiceCreateRequest, *adminv2.SizeServiceUpdateRequest, *apiv2.SizeQuery]
}
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) FilesystemLayout ¶
func (s *Store) FilesystemLayout() FilesystemLayout
func (*Store) IpDeleteHandleFn ¶
func (*Store) MachineBMCCommandHandleFn ¶ added in v0.1.2
func (*Store) MachineDeleteHandleFn ¶ added in v0.0.6
func (*Store) NetworkDeleteHandleFn ¶ added in v0.0.3
NetworkDeleteHandleFn is called async to ensure all dependent entities are deleted Async deletion must be scheduled by async.NewNetworkDeleteTask
func (*Store) UnscopedIP ¶
func (s *Store) UnscopedIP() IP
func (*Store) UnscopedMachine ¶ added in v0.0.6
func (s *Store) UnscopedMachine() Machine
func (*Store) UnscopedNetwork ¶
func (s *Store) UnscopedNetwork() Network
func (*Store) UnscopedProject ¶
func (s *Store) UnscopedProject() Project
type Switch ¶ added in v0.0.8
type Switch interface {
Repository[*switchRepository, *apiv2.Switch, *SwitchServiceCreateRequest, *adminv2.SwitchServiceUpdateRequest, *apiv2.SwitchQuery]
}
type SwitchServiceCreateRequest ¶ added in v0.0.8
type SwitchStatus ¶ added in v0.1.0
type SwitchStatus struct {
ID string
LastSync *apiv2.SwitchSync
LastSyncError *apiv2.SwitchSync
}
func (*SwitchStatus) GetID ¶ added in v0.1.2
func (s *SwitchStatus) GetID() string
type Tenant ¶
type Tenant interface {
Repository[*tenantRepository, *apiv2.Tenant, *apiv2.TenantServiceCreateRequest, *apiv2.TenantServiceUpdateRequest, *apiv2.TenantServiceListRequest]
}
type TenantMember ¶ added in v0.0.6
type TenantMember interface {
Repository[*tenantMemberRepository, *apiv2.TenantMember, *TenantMemberCreateRequest, *TenantMemberUpdateRequest, *TenantMemberQuery]
}
type TenantMemberCreateRequest ¶ added in v0.0.6
type TenantMemberCreateRequest struct {
MemberID string
Role apiv2.TenantRole
}
type TenantMemberQuery ¶ added in v0.0.6
type TenantMemberUpdateRequest ¶ added in v0.0.6
type TenantMemberUpdateRequest struct {
Role apiv2.TenantRole
}
func (*TenantMemberUpdateRequest) GetUpdateMeta ¶ added in v0.0.8
func (*TenantMemberUpdateRequest) GetUpdateMeta() *apiv2.UpdateMeta
type TenantScope ¶ added in v0.0.6
type TenantScope struct {
// contains filtered or unexported fields
}
type TenantWithMembershipAnnotations ¶ added in v0.0.9
type UpdateMessage ¶
type UpdateMessage interface {
GetUpdateMeta() *apiv2.UpdateMeta
}
UpdateMessage is an external request to update an entity for consumers.
Source Files
¶
- common.go
- filesystemlayout-validation.go
- filesystemlayout.go
- image.go
- ip-validation.go
- ip.go
- machine-validation.go
- machine.go
- network-validation.go
- network.go
- partition-validation.go
- partition.go
- project-member-validation.go
- project-member.go
- project-validation.go
- project.go
- repository.go
- size-validation.go
- size.go
- store.go
- switch-validation.go
- switch.go
- tenant-member-validation.go
- tenant-member.go
- tenant-validation.go
- tenant.go