Documentation
¶
Overview ¶
Package models implements the agent models
Index ¶
Constants ¶
View Source
const ( FieldAccountAccountID = "account_id" FieldAccountName = "name" FieldTenantAccountID = "account_id" FieldTenantTenantID = "tenant_id" FieldTenantName = "name" FieldIdentitySourceAccountID = "account_id" FieldIdentitySourceName = "name" FieldIdentitySourceIdentitySourceID = "identity_source_id" FieldIdentityAccountID = "account_id" FieldIdentityIdentitySourceID = "identity_source_id" FieldIdentityIdentityID = "identity_id" FieldIdentityName = "name" FieldIdentityKind = "kind" )
View Source
const ( FieldRepositoryAccountID = "account_id" FieldRepositoryRepositoryID = "repository_id" FieldRepositoryName = "name" FieldSchemaSchemaID = "schema_id" FieldSchemaAccountID = "account_id" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { AccountID int64 `json:"account_id" validate:"required,gt=0"` CreatedAt time.Time `json:"created_at" validate:"required"` UpdatedAt time.Time `json:"updated_at" validate:"required"` Name string `json:"name" validate:"required,name"` }
Account is the account.
type Action ¶
type Action struct { Name string `json:"name" yaml:"name" validate:"required"` Description string `json:"description" yaml:"description"` }
Action is the action.
type Domain ¶
type Domain struct { Name string `json:"name" yaml:"name" validate:"required"` Description string `json:"description" yaml:"description"` Resources []Resource `json:"resources" yaml:"resources" validate:"required"` }
Domain is the domain.
type Identity ¶
type Identity struct { IdentityID string `json:"identity_id" validate:"required,isuuid"` CreatedAt time.Time `json:"created_at" validate:"required"` UpdatedAt time.Time `json:"updated_at" validate:"required"` AccountID int64 `json:"account_id" validate:"required,gt=0"` IdentitySourceID string `json:"identity_source_id" validate:"required,isuuid"` Kind string `json:"identity_type" validate:"required,oneof='user' 'role'"` Name string `json:"name" validate:"required"` }
Identity is the entity representing the user or role
type IdentitySource ¶
type IdentitySource struct { IdentitySourceID string `json:"identity_source_id" validate:"required,isuuid"` CreatedAt time.Time `json:"created_at" validate:"required"` UpdatedAt time.Time `json:"updated_at" validate:"required"` AccountID int64 `json:"account_id" validate:"required,gt=0"` Name string `json:"name" validate:"required"` }
IdentitySource represent and identity source
type Repository ¶
type Repository struct { RepositoryID string `json:"repository_id" validate:"required,isuuid"` CreatedAt time.Time `json:"created_at" validate:"required"` UpdatedAt time.Time `json:"updated_at" validate:"required"` AccountID int64 `json:"account_id" validate:"required,gt=0"` Name string `json:"name"` }
Repository is the repository.
type Resource ¶
type Resource struct { Name string `json:"name" yaml:"name" validate:"required"` Description string `json:"description" yaml:"description"` Actions []Action `json:"actions" yaml:"actions" validate:"required"` }
Resource is the resource.
type Schema ¶
type Schema struct { SchemaID string `json:"schema_id" validate:"required,isuuid"` CreatedAt time.Time `json:"created_at" validate:"required"` UpdatedAt time.Time `json:"updated_at" validate:"required"` AccountID int64 `json:"account_id" validate:"required,gt=0"` RepositoryID string `json:"repository_id" validate:"required,isuuid"` RepositoryName string `json:"repository_name"` SchemaDomains *SchemaDomains `json:"domains" validate:"required"` }
Schema is the schema.
type SchemaDomains ¶
type SchemaDomains struct {
Domains []Domain `json:"domains" yaml:"domains"`
}
SchemaDomains is the schema domains.
func (*SchemaDomains) Validate ¶
func (s *SchemaDomains) Validate() (bool, error)
Validate validates the schema payload.
type Tenant ¶
type Tenant struct { TenantID string `json:"tenant_id" validate:"required,isuuid"` CreatedAt time.Time `json:"created_at" validate:"required"` UpdatedAt time.Time `json:"updated_at" validate:"required"` AccountID int64 `json:"account_id" validate:"required,gt=0"` Name string `json:"name"` }
Tenant is the tenant.
Click to show internal directories.
Click to hide internal directories.