Documentation
¶
Index ¶
- type CreateMessage
- type Entity
- type FilesystemLayout
- type IP
- type Image
- type Message
- type Network
- type Partition
- type Project
- type ProjectScope
- type Query
- type Repo
- type Repository
- 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) 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) Tenant() Tenant
- func (s *Store) UnscopedIP() IP
- func (s *Store) UnscopedNetwork() Network
- func (s *Store) UnscopedProject() Project
- type Tenant
- type UpdateMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 ¶
type Entity any
Entity is the internal representation of an api resource, which is stored in the backend.
type FilesystemLayout ¶
type FilesystemLayout interface {
Repository[*filesystemLayoutRepository, *metal.FilesystemLayout, *apiv2.FilesystemLayout, *adminv2.FilesystemServiceCreateRequest, *adminv2.FilesystemServiceUpdateRequest, *apiv2.FilesystemServiceListRequest]
}
type IP ¶
type IP interface {
Repository[*ipRepository, *metal.IP, *apiv2.IP, *apiv2.IPServiceCreateRequest, *apiv2.IPServiceUpdateRequest, *apiv2.IPQuery]
}
type Image ¶
type Image interface {
Repository[*imageRepository, *metal.Image, *apiv2.Image, *adminv2.ImageServiceCreateRequest, *adminv2.ImageServiceUpdateRequest, *apiv2.ImageQuery]
}
type Message ¶
type Message any
Message is the external representation of an api resource for consumers.
type Network ¶
type Network interface {
Repository[*networkRepository, *metal.Network, *apiv2.Network, *adminv2.NetworkServiceCreateRequest, *adminv2.NetworkServiceUpdateRequest, *apiv2.NetworkQuery]
}
type Partition ¶
type Partition interface {
Repository[*partitionRepository, *metal.Partition, *apiv2.Partition, *adminv2.PartitionServiceCreateRequest, *adminv2.PartitionServiceUpdateRequest, *apiv2.PartitionQuery]
}
type Project ¶
type Project interface {
Repository[*projectRepository, *mdcv1.Project, *apiv2.Project, *apiv2.ProjectServiceCreateRequest, *apiv2.ProjectServiceUpdateRequest, *apiv2.ProjectServiceListRequest]
}
type ProjectScope ¶
type ProjectScope struct {
// contains filtered or unexported fields
}
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, E Entity, M Message, C CreateMessage, U UpdateMessage, Q Query] interface {
Get(ctx context.Context, id string) (E, error)
Create(ctx context.Context, c C) (E, error)
Update(ctx context.Context, id string, u U) (E, error)
Delete(ctx context.Context, id string) (E, error)
Find(ctx context.Context, query Q) (E, error)
List(ctx context.Context, query Q) ([]E, error)
ConvertToInternal(msg M) (E, error)
ConvertToProto(e E) (M, error)
AdditionalMethods() R
}
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) FilesystemLayout ¶
func (s *Store) FilesystemLayout() FilesystemLayout
func (*Store) IpDeleteHandleFn ¶
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) UnscopedNetwork ¶
func (s *Store) UnscopedNetwork() Network
func (*Store) UnscopedProject ¶
func (s *Store) UnscopedProject() Project
type Tenant ¶
type Tenant interface {
Repository[*tenantRepository, *mdcv1.Tenant, *apiv2.Tenant, *apiv2.TenantServiceCreateRequest, *apiv2.TenantServiceUpdateRequest, *apiv2.TenantServiceListRequest]
}
type UpdateMessage ¶
type UpdateMessage any
UpdateMessage is an external request to update an entity for consumers.