Documentation ¶
Index ¶
- Variables
- type Device
- type DeviceList
- type EnrollmentRequest
- type EnrollmentRequestList
- type Fleet
- type FleetList
- type JSONField
- type Repository
- type RepositoryList
- type Resource
- type ResourceSync
- func (rs *ResourceSync) AddPathAccessCondition(err error)
- func (rs *ResourceSync) AddRepoAccessCondition(err error)
- func (rs *ResourceSync) AddRepoNotFoundCondition(err error)
- func (rs *ResourceSync) AddResourceParsedCondition(err error)
- func (rs *ResourceSync) AddSyncedCondition(err error)
- func (rs *ResourceSync) NeedsSyncToHash(hash string) bool
- func (rs *ResourceSync) SetCondition(conditionType api.ConditionType, okReason, failReason string, err error) bool
- func (r *ResourceSync) String() string
- func (r *ResourceSync) ToApiResource() api.ResourceSync
- type ResourceSyncList
- type ResourceWithPrimaryKeyOwner
- type TemplateVersion
- type TemplateVersionList
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DeviceAPI = "v1alpha1" DeviceKind = "Device" DeviceListKind = "DeviceList" DeviceAnnotationMultipleOwners = "MultipleOwners" )
View Source
var ( EnrollmentRequestAPI = "v1alpha1" EnrollmentRequestKind = "EnrollmentRequest" EnrollmentRequestListKind = "EnrollmentRequestList" )
View Source
var ( FleetAPI = "v1alpha1" FleetKind = "Fleet" FleetListKind = "FleetList" )
View Source
var ( RepositoryAPI = "v1alpha1" RepositoryKind = "Repository" RepositoryListKind = "RepositoryList" )
View Source
var ( ResourceSyncAPI = "v1alpha1" ResourceSyncKind = "ResourceSync" ResourceSyncListKind = "ResourceSyncList" )
View Source
var ( TemplateVersionAPI = "v1alpha1" TemplateVersionKind = "TemplateVersion" TemplateVersionListKind = "TemplateVersionList" )
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct { Resource // The desired state, stored as opaque JSON object. Spec *JSONField[api.DeviceSpec] // The last reported state, stored as opaque JSON object. Status *JSONField[api.DeviceStatus] }
func (*Device) ToApiResource ¶
type DeviceList ¶
type DeviceList []Device
func (DeviceList) ToApiResource ¶
func (dl DeviceList) ToApiResource(cont *string, numRemaining *int64) api.DeviceList
type EnrollmentRequest ¶
type EnrollmentRequest struct { Resource // The desired state of the enrollment request, stored as opaque JSON object. Spec *JSONField[api.EnrollmentRequestSpec] // The last reported state of the enrollment request, stored as opaque JSON object. Status *JSONField[api.EnrollmentRequestStatus] }
func NewEnrollmentRequestFromApiResource ¶
func NewEnrollmentRequestFromApiResource(resource *api.EnrollmentRequest) *EnrollmentRequest
func (EnrollmentRequest) String ¶
func (e EnrollmentRequest) String() string
func (*EnrollmentRequest) ToApiResource ¶
func (e *EnrollmentRequest) ToApiResource() api.EnrollmentRequest
type EnrollmentRequestList ¶
type EnrollmentRequestList []EnrollmentRequest
func (EnrollmentRequestList) ToApiResource ¶
func (el EnrollmentRequestList) ToApiResource(cont *string, numRemaining *int64) api.EnrollmentRequestList
type Fleet ¶
type Fleet struct { Resource // The desired state, stored as opaque JSON object. Spec *JSONField[api.FleetSpec] // The last reported state, stored as opaque JSON object. Status *JSONField[api.FleetStatus] }
func NewFleetFromApiResource ¶
func (*Fleet) ToApiResource ¶
type JSONField ¶
type JSONField[T any] struct { Data T }
JSONField wraps an arbitrary struct so that it can be included in a GORM model, for use in a JSON/JSONB field
func MakeJSONField ¶
Return a copy of 'data', wrapped in a JSONField object
func (JSONField[T]) MarshalJSON ¶
func (*JSONField[T]) UnmarshalJSON ¶
type Repository ¶
type Repository struct { Resource // The desired state, stored as opaque JSON object. Spec *JSONField[api.RepositorySpec] // The last reported state, stored as opaque JSON object. Status *JSONField[api.RepositoryStatus] }
func NewRepositoryFromApiResource ¶
func NewRepositoryFromApiResource(resource *api.Repository) *Repository
func (Repository) String ¶
func (d Repository) String() string
func (*Repository) ToApiResource ¶
func (f *Repository) ToApiResource() api.Repository
type RepositoryList ¶
type RepositoryList []Repository
func (RepositoryList) ToApiResource ¶
func (dl RepositoryList) ToApiResource(cont *string, numRemaining *int64) api.RepositoryList
type Resource ¶
type Resource struct { // Uniquely identifies the tenant the resource belongs to. // Assigned by IAM. Immutable. OrgID uuid.UUID `gorm:"type:uuid;primary_key;"` // Uniquely identifies the resource within a tenant and schema. // Depending on the schema (kind), assigned by the device management system or the crypto identity of the device (public key). Immutable. // This may become a URN later, so it's important API users treat this as an opaque handle. Name string `gorm:"primary_key;"` // The "kind/name" of the resource owner of this resource. Owner *string // User-defined labels, used to select resources in queries. // Labels are inserted in the device column as a string array, in a way // that we can perform indexing and queries on them. Labels pq.StringArray `gorm:"type:text[]"` Annotations pq.StringArray `gorm:"type:text[]"` Generation *int64 CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` }
type ResourceSync ¶
type ResourceSync struct { Resource // The desired state, stored as opaque JSON object. Spec *JSONField[api.ResourceSyncSpec] // The last reported state, stored as opaque JSON object. Status *JSONField[api.ResourceSyncStatus] }
func NewResourceSyncFromApiResource ¶
func NewResourceSyncFromApiResource(resource *api.ResourceSync) *ResourceSync
func (*ResourceSync) AddPathAccessCondition ¶
func (rs *ResourceSync) AddPathAccessCondition(err error)
func (*ResourceSync) AddRepoAccessCondition ¶
func (rs *ResourceSync) AddRepoAccessCondition(err error)
func (*ResourceSync) AddRepoNotFoundCondition ¶
func (rs *ResourceSync) AddRepoNotFoundCondition(err error)
func (*ResourceSync) AddResourceParsedCondition ¶
func (rs *ResourceSync) AddResourceParsedCondition(err error)
func (*ResourceSync) AddSyncedCondition ¶
func (rs *ResourceSync) AddSyncedCondition(err error)
func (*ResourceSync) NeedsSyncToHash ¶
func (rs *ResourceSync) NeedsSyncToHash(hash string) bool
NeedsSyncToHash returns true if the resource needs to be synced to the given hash.
func (*ResourceSync) SetCondition ¶
func (rs *ResourceSync) SetCondition(conditionType api.ConditionType, okReason, failReason string, err error) bool
func (*ResourceSync) String ¶
func (r *ResourceSync) String() string
func (*ResourceSync) ToApiResource ¶
func (r *ResourceSync) ToApiResource() api.ResourceSync
type ResourceSyncList ¶
type ResourceSyncList []ResourceSync
func (ResourceSyncList) ToApiResource ¶
func (rl ResourceSyncList) ToApiResource(cont *string, numRemaining *int64) api.ResourceSyncList
type ResourceWithPrimaryKeyOwner ¶
type ResourceWithPrimaryKeyOwner struct { OrgID uuid.UUID `gorm:"type:uuid;primary_key;"` Name string `gorm:"primary_key;"` Owner *string `gorm:"primary_key;"` Labels pq.StringArray `gorm:"type:text[]"` Annotations pq.StringArray `gorm:"type:text[]"` Generation *int64 CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` }
type TemplateVersion ¶
type TemplateVersion struct { ResourceWithPrimaryKeyOwner // The desired state, stored as opaque JSON object. Spec *JSONField[api.TemplateVersionSpec] // The last reported state, stored as opaque JSON object. Status *JSONField[api.TemplateVersionStatus] // The rendered ignition config, exposed in a separate endpoint. RenderedConfig *string // An indication if this version is valid. It exposed in a Condition but easier to query here. Valid *bool }
func NewTemplateVersionFromApiResource ¶
func NewTemplateVersionFromApiResource(resource *api.TemplateVersion) *TemplateVersion
func (TemplateVersion) String ¶
func (t TemplateVersion) String() string
func (*TemplateVersion) ToApiResource ¶
func (t *TemplateVersion) ToApiResource() api.TemplateVersion
type TemplateVersionList ¶
type TemplateVersionList []TemplateVersion
func (TemplateVersionList) ToApiResource ¶
func (tl TemplateVersionList) ToApiResource(cont *string, numRemaining *int64) api.TemplateVersionList
Click to show internal directories.
Click to hide internal directories.