Documentation ¶
Index ¶
- Constants
- type GormLabelRepository
- func (m *GormLabelRepository) Create(ctx context.Context, u *Label) error
- func (m *GormLabelRepository) IsValid(ctx context.Context, id uuid.UUID) bool
- func (m *GormLabelRepository) List(ctx context.Context, spaceID uuid.UUID) ([]Label, error)
- func (m *GormLabelRepository) Load(ctx context.Context, ID uuid.UUID) (*Label, error)
- func (m *GormLabelRepository) Save(ctx context.Context, l Label) (*Label, error)
- type Label
- type Repository
Constants ¶
View Source
const APIStringTypeLabels = "labels"
APIStringTypeLabels helps to avoid string literal
View Source
const LabelTableName = "labels"
LabelTableName constant that holds table name of Labels
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GormLabelRepository ¶
type GormLabelRepository struct {
// contains filtered or unexported fields
}
GormLabelRepository is the implementation of the storage interface for Labels.
func (*GormLabelRepository) Create ¶
func (m *GormLabelRepository) Create(ctx context.Context, u *Label) error
Create a new label
type Label ¶
type Label struct { gormsupport.Lifecycle ID uuid.UUID `sql:"type:uuid default uuid_generate_v4()" gorm:"primary_key"` // This is the ID PK field SpaceID uuid.UUID `sql:"type:uuid"` Name string TextColor string `sql:"DEFAULT:#000000"` BackgroundColor string `sql:"DEFAULT:#FFFFFF"` BorderColor string `sql:"DEFAULT:#000000"` Version int }
Label describes a single Label
func (Label) GetETagData ¶
func (m Label) GetETagData() []interface{}
GetETagData returns the field values to use to generate the ETag
func (Label) GetLastModified ¶
GetLastModified returns the last modification time
type Repository ¶
type Repository interface { Create(ctx context.Context, u *Label) error List(ctx context.Context, spaceID uuid.UUID) ([]Label, error) IsValid(ctx context.Context, id uuid.UUID) bool Load(ctx context.Context, labelID uuid.UUID) (*Label, error) Save(ctx context.Context, lbl Label) (*Label, error) }
Repository describes interactions with Labels
func NewLabelRepository ¶
func NewLabelRepository(db *gorm.DB) Repository
NewLabelRepository creates a new storage type.
Click to show internal directories.
Click to hide internal directories.