Documentation ¶
Index ¶
- func ResourceTypeFilterByID(resourceTypeID uuid.UUID) func(db *gorm.DB) *gorm.DB
- type GormResourceRepository
- func (m *GormResourceRepository) CheckExists(ctx context.Context, id string) error
- func (m *GormResourceRepository) Create(ctx context.Context, resource *Resource) error
- func (m *GormResourceRepository) Delete(ctx context.Context, id string) error
- func (m *GormResourceRepository) Load(ctx context.Context, id string) (*Resource, error)
- func (m *GormResourceRepository) Save(ctx context.Context, resource *Resource) error
- func (m *GormResourceRepository) TableName() string
- type GormResourceTypeRepository
- func (m *GormResourceTypeRepository) CheckExists(ctx context.Context, id string) (bool, error)
- func (m *GormResourceTypeRepository) Create(ctx context.Context, u *ResourceType) error
- func (m *GormResourceTypeRepository) Delete(ctx context.Context, id uuid.UUID) error
- func (m *GormResourceTypeRepository) List(ctx context.Context) ([]ResourceType, error)
- func (m *GormResourceTypeRepository) Load(ctx context.Context, id uuid.UUID) (*ResourceType, error)
- func (m *GormResourceTypeRepository) Save(ctx context.Context, model *ResourceType) error
- func (m *GormResourceTypeRepository) TableName() string
- type GormResourceTypeScopeRepository
- func (m *GormResourceTypeScopeRepository) CheckExists(ctx context.Context, id string) (bool, error)
- func (m *GormResourceTypeScopeRepository) Create(ctx context.Context, u *ResourceTypeScope) error
- func (m *GormResourceTypeScopeRepository) Delete(ctx context.Context, id uuid.UUID) error
- func (m *GormResourceTypeScopeRepository) List(ctx context.Context, resourceType *ResourceType) ([]ResourceTypeScope, error)
- func (m *GormResourceTypeScopeRepository) Load(ctx context.Context, id uuid.UUID) (*ResourceTypeScope, error)
- func (m *GormResourceTypeScopeRepository) Save(ctx context.Context, model *ResourceTypeScope) error
- func (m *GormResourceTypeScopeRepository) TableName() string
- type Resource
- type ResourceRepository
- type ResourceType
- type ResourceTypeRepository
- type ResourceTypeScope
- type ResourceTypeScopeRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GormResourceRepository ¶
type GormResourceRepository struct {
// contains filtered or unexported fields
}
GormResourceRepository is the implementation of the storage interface for Resource.
func (*GormResourceRepository) CheckExists ¶
func (m *GormResourceRepository) CheckExists(ctx context.Context, id string) error
CheckExists returns nil if the given ID exists otherwise returns an error
func (*GormResourceRepository) Create ¶
func (m *GormResourceRepository) Create(ctx context.Context, resource *Resource) error
Create creates a new record.
func (*GormResourceRepository) Delete ¶
func (m *GormResourceRepository) Delete(ctx context.Context, id string) error
Delete removes a single record.
func (*GormResourceRepository) Save ¶
func (m *GormResourceRepository) Save(ctx context.Context, resource *Resource) error
Save modifies a single record.
func (*GormResourceRepository) TableName ¶
func (m *GormResourceRepository) TableName() string
TableName overrides the table name settings in Gorm to force a specific table name in the database.
type GormResourceTypeRepository ¶
type GormResourceTypeRepository struct {
// contains filtered or unexported fields
}
GormResourceTypeRepository is the implementation of the storage interface for ResourceType.
func (*GormResourceTypeRepository) CheckExists ¶
CheckExists returns nil if the given ID exists otherwise returns an error
func (*GormResourceTypeRepository) Create ¶
func (m *GormResourceTypeRepository) Create(ctx context.Context, u *ResourceType) error
Create creates a new record.
func (*GormResourceTypeRepository) Delete ¶
func (m *GormResourceTypeRepository) Delete(ctx context.Context, id uuid.UUID) error
Delete removes a single record.
func (*GormResourceTypeRepository) List ¶
func (m *GormResourceTypeRepository) List(ctx context.Context) ([]ResourceType, error)
List return all resource types
func (*GormResourceTypeRepository) Load ¶
func (m *GormResourceTypeRepository) Load(ctx context.Context, id uuid.UUID) (*ResourceType, error)
Load returns a single ResourceType as a Database Model This is more for use internally, and probably not what you want in your controllers
func (*GormResourceTypeRepository) Save ¶
func (m *GormResourceTypeRepository) Save(ctx context.Context, model *ResourceType) error
Save modifies a single record
func (*GormResourceTypeRepository) TableName ¶
func (m *GormResourceTypeRepository) TableName() string
TableName overrides the table name settings in Gorm to force a specific table name in the database.
type GormResourceTypeScopeRepository ¶
type GormResourceTypeScopeRepository struct {
// contains filtered or unexported fields
}
GormResourceTypeScopeRepository is the implementation of the storage interface for ResourceTypeScope.
func (*GormResourceTypeScopeRepository) CheckExists ¶
CheckExists returns nil if the given ID exists otherwise returns an error
func (*GormResourceTypeScopeRepository) Create ¶
func (m *GormResourceTypeScopeRepository) Create(ctx context.Context, u *ResourceTypeScope) error
Create creates a new record.
func (*GormResourceTypeScopeRepository) Delete ¶
func (m *GormResourceTypeScopeRepository) Delete(ctx context.Context, id uuid.UUID) error
Delete removes a single record.
func (*GormResourceTypeScopeRepository) List ¶
func (m *GormResourceTypeScopeRepository) List(ctx context.Context, resourceType *ResourceType) ([]ResourceTypeScope, error)
List return all resource type scopes
func (*GormResourceTypeScopeRepository) Load ¶
func (m *GormResourceTypeScopeRepository) Load(ctx context.Context, id uuid.UUID) (*ResourceTypeScope, error)
Load returns a single ResourceTypeScope as a Database Model This is more for use internally, and probably not what you want in your controllers
func (*GormResourceTypeScopeRepository) Save ¶
func (m *GormResourceTypeScopeRepository) Save(ctx context.Context, model *ResourceTypeScope) error
Save modifies a single record
func (*GormResourceTypeScopeRepository) TableName ¶
func (m *GormResourceTypeScopeRepository) TableName() string
TableName overrides the table name settings in Gorm to force a specific table name in the database.
type Resource ¶
type Resource struct { gormsupport.Lifecycle // This is the primary key value ResourceID string `sql:"type:string" gorm:"primary_key" gorm:"column:resource_id"` // The parent resource ParentResource *Resource // The owning identity Owner account.Identity // The resource type ResourceType ResourceType // Resource description Description string }
func (Resource) GetLastModified ¶
GetLastModified returns the last modification time
type ResourceRepository ¶
type ResourceRepository interface { repository.Exister Load(ctx context.Context, id string) (*Resource, error) Create(ctx context.Context, resource *Resource) error Save(ctx context.Context, resource *Resource) error Delete(ctx context.Context, id string) error }
ResourceRepository represents the storage interface.
func NewResourceRepository ¶
func NewResourceRepository(db *gorm.DB) ResourceRepository
NewResourceRepository creates a new storage type.
type ResourceType ¶
type ResourceType struct { gormsupport.Lifecycle ResourceTypeID uuid.UUID `sql:"type:uuid default uuid_generate_v4()" gorm:"primary_key" gorm:"column:resource_type_id"` // The resource type name Name string // The resource type description Description string }
func (ResourceType) GetLastModified ¶
func (m ResourceType) GetLastModified() time.Time
GetLastModified returns the last modification time
func (ResourceType) TableName ¶
func (m ResourceType) TableName() string
TableName overrides the table name settings in Gorm to force a specific table name in the database.
type ResourceTypeRepository ¶
type ResourceTypeRepository interface { CheckExists(ctx context.Context, id string) (bool, error) Load(ctx context.Context, ID uuid.UUID) (*ResourceType, error) Create(ctx context.Context, u *ResourceType) error Save(ctx context.Context, u *ResourceType) error List(ctx context.Context) ([]ResourceType, error) Delete(ctx context.Context, ID uuid.UUID) error }
ResourceTypeRepository represents the storage interface.
func NewResourceTypeRepository ¶
func NewResourceTypeRepository(db *gorm.DB) ResourceTypeRepository
NewResourceTypeRepository creates a new storage type.
type ResourceTypeScope ¶
type ResourceTypeScope struct { gormsupport.Lifecycle // This is the primary key value ResourceTypeScopeID uuid.UUID `sql:"type:uuid default uuid_generate_v4()" gorm:"primary_key" gorm:"column:resource_type_scope_id"` // The resource type that this scope belongs to ResourceType ResourceType `gorm:"ForeignKey:ResourceTypeID;AssociationForeignKey:ResourceTypeID"` // The foreign key value for ResourceType ResourceTypeID uuid.UUID // The name of this scope Name string // The description of this scope Description string }
func (ResourceTypeScope) GetLastModified ¶
func (m ResourceTypeScope) GetLastModified() time.Time
GetLastModified returns the last modification time
func (ResourceTypeScope) TableName ¶
func (m ResourceTypeScope) TableName() string
TableName overrides the table name settings in Gorm to force a specific table name in the database.
type ResourceTypeScopeRepository ¶
type ResourceTypeScopeRepository interface { CheckExists(ctx context.Context, id string) (bool, error) Load(ctx context.Context, ID uuid.UUID) (*ResourceTypeScope, error) Create(ctx context.Context, u *ResourceTypeScope) error Save(ctx context.Context, u *ResourceTypeScope) error List(ctx context.Context, resourceType *ResourceType) ([]ResourceTypeScope, error) Delete(ctx context.Context, ID uuid.UUID) error }
ResourceTypeScopeRepository represents the storage interface.
func NewResourceTypeScopeRepository ¶
func NewResourceTypeScopeRepository(db *gorm.DB) ResourceTypeScopeRepository
NewResourceTypeScopeRepository creates a new storage type.