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 Audit
- type Component
- type Config
- type CreateMessage
- type Entity
- type FilesystemLayout
- type IP
- type Image
- type InjectRethinkDbError
- type Machine
- type Message
- type Network
- type Partition
- type Project
- type ProjectMember
- type ProjectScope
- type Query
- type Repo
- type Repository
- type Size
- type SizeImageConstraint
- type SizeReservation
- type Store
- func (s *Store) Audit(tenant string) Audit
- func (s *Store) Component() Component
- 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) SizeImageConstraint() SizeImageConstraint
- func (s *Store) SizeReservation(project string) SizeReservation
- func (s *Store) Switch() Switch
- func (s *Store) Task() *task.Client
- func (s *Store) Tenant() Tenant
- func (s *Store) UnscopedAudit() Audit
- func (s *Store) UnscopedIP() IP
- func (s *Store) UnscopedMachine() Machine
- func (s *Store) UnscopedNetwork() Network
- func (s *Store) UnscopedProject() Project
- func (s *Store) UnscopedSizeReservation() SizeReservation
- func (s *Store) UnscopedVPN() *vpn
- func (s *Store) VPN(project string) *vpn
- type Switch
- type Tenant
- type TenantMember
- type TenantScope
- type UpdateMessage
Constants ¶
const ( // ASNMin is the minimum asn defined according to // https://en.wikipedia.org/wiki/Autonomous_system_(Internet) ASNMin = uint32(4200000000) // ASNBase is the offset for all Machine ASN´s ASNBase = uint32(4210000000) // ASNMax defines the maximum allowed asn // https://en.wikipedia.org/wiki/Autonomous_system_(Internet) ASNMax = uint32(4294967294) )
const ( // This policy allows all users to access their own devices. // It is suitable for many use cases where you want to // allow users to access their own devices, but not other devices in the tailnet. HeadscaleDefaultPolicy = `{ "acls": [ { "action": "accept", "src": ["autogroup:member"], "dst": ["autogroup:self:*"] } ] }` )
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 Audit ¶ added in v0.1.8
type Audit interface {
Repository[*auditRepository, *apiv2.AuditTrace, any, *auditEntity, *apiv2.AuditQuery]
}
type Component ¶ added in v0.1.6
type Component interface {
Repository[*componentRepository, *apiv2.Component, *api.ComponentServiceCreateRequest, *api.ComponentServiceUpdateRequest, *apiv2.ComponentQuery]
}
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 InjectRethinkDbError ¶ added in v0.2.0
type InjectRethinkDbError string
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, *api.ProjectMemberCreateRequest, *api.ProjectMemberUpdateRequest, *api.ProjectMemberQuery]
}
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, M Message, C CreateMessage, U UpdateMessage, Q Query] interface {
// Get returns the API entity with the given id.
Get(ctx context.Context, id string) (M, error)
// Create creates the entity from the given create request and returns the API entity.
Create(ctx context.Context, c C) (M, error)
// Update updates the entity from the given update request and returns the API entity.
Update(ctx context.Context, id string, u U) (M, error)
// Delete deletes the API entity with the given id.
Delete(ctx context.Context, id string) (M, error)
// Find returns exactly the one API entity matched by the given query.
// For multiple or no results an error is returned.
Find(ctx context.Context, query Q) (M, error)
// List returns the API entities matched by the given query.
List(ctx context.Context, query Q) ([]M, error)
// AdditionalMethods allows access to more specific, non-crud operations of a repository store.
AdditionalMethods() R
}
Repository implements the basic CRUD operations (business logic) for the consuming API services. It shadows internal data representations from external API representations. It offers scopes during initialization so that resource operations can be scoped by projects and tenants. It ensures that all functions return a connect error, except those called from AdditionalMethods(). Therefore, consumers do not need to convert errors to connect errors.
type Size ¶ added in v0.0.5
type Size interface {
Repository[*sizeRepository, *apiv2.Size, *adminv2.SizeServiceCreateRequest, *adminv2.SizeServiceUpdateRequest, *apiv2.SizeQuery]
}
type SizeImageConstraint ¶ added in v0.1.7
type SizeImageConstraint interface {
Repository[*sizeImageConstraintRepository, *apiv2.SizeImageConstraint, *adminv2.SizeImageConstraintServiceCreateRequest, *adminv2.SizeImageConstraintServiceUpdateRequest, *apiv2.SizeImageConstraintQuery]
}
type SizeReservation ¶ added in v0.1.3
type SizeReservation interface {
Repository[*sizeReservationRepository, *apiv2.SizeReservation, *adminv2.SizeReservationServiceCreateRequest, *adminv2.SizeReservationServiceUpdateRequest, *apiv2.SizeReservationQuery]
}
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) SizeImageConstraint ¶ added in v0.1.7
func (s *Store) SizeImageConstraint() SizeImageConstraint
func (*Store) SizeReservation ¶ added in v0.1.3
func (*Store) UnscopedAudit ¶ added in v0.1.8
func (s *Store) UnscopedAudit() Audit
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
func (*Store) UnscopedSizeReservation ¶ added in v0.1.3
func (s *Store) UnscopedSizeReservation() SizeReservation
func (*Store) UnscopedVPN ¶ added in v0.1.9
func (s *Store) UnscopedVPN() *vpn
type Switch ¶ added in v0.0.8
type Switch interface {
Repository[*switchRepository, *apiv2.Switch, *api.SwitchServiceCreateRequest, *adminv2.SwitchServiceUpdateRequest, *apiv2.SwitchQuery]
}
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, *api.TenantMemberCreateRequest, *api.TenantMemberUpdateRequest, *api.TenantMemberQuery]
}
type TenantScope ¶ added in v0.0.6
type TenantScope struct {
// contains filtered or unexported fields
}
type UpdateMessage ¶
type UpdateMessage interface {
GetUpdateMeta() *apiv2.UpdateMeta
}
UpdateMessage is an external request to update an entity for consumers.
Source Files
¶
- asn.go
- audit.go
- common.go
- component.go
- filesystemlayout-validation.go
- filesystemlayout.go
- image-validation.go
- image.go
- ip-validation.go
- ip.go
- machine-create.go
- machine-rack-spreading.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-image-constraint-validation.go
- size-image-constraint.go
- size-reservation-validation.go
- size-reservation.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
- vpn.go