Documentation
¶
Index ¶
- type Context
- type ContextRepository
- type ContextSetSpec
- type MySQLRepository
- func (repository MySQLRepository) CreateAll(ctx context.Context, contexts []Context) ([]Context, error)
- func (repository MySQLRepository) DeleteAllByWarrantId(ctx context.Context, warrantId int64) error
- func (repository MySQLRepository) ListByWarrantId(ctx context.Context, warrantIds []int64) ([]Context, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
Id int64 `db:"id"`
WarrantId int64 `db:"warrantId"`
Name string `db:"name"`
Value string `db:"value"`
CreatedAt time.Time `db:"createdAt"`
UpdatedAt time.Time `db:"updatedAt"`
DeletedAt database.NullTime `db:"deletedAt"`
}
Context model
type ContextRepository ¶
type ContextRepository interface {
CreateAll(ctx context.Context, contexts []Context) ([]Context, error)
ListByWarrantId(ctx context.Context, warrantIds []int64) ([]Context, error)
DeleteAllByWarrantId(ctx context.Context, warrantId int64) error
}
func NewRepository ¶
func NewRepository(db database.Database) (ContextRepository, error)
type ContextSetSpec ¶
func NewContextSetSpecFromSlice ¶
func NewContextSetSpecFromSlice(contexts []Context) ContextSetSpec
func StringToContextSetSpec ¶
func StringToContextSetSpec(str string) (ContextSetSpec, error)
func (ContextSetSpec) Equals ¶
func (spec ContextSetSpec) Equals(compareTo ContextSetSpec) bool
func (ContextSetSpec) String ¶
func (spec ContextSetSpec) String() string
func (ContextSetSpec) ToHash ¶
func (spec ContextSetSpec) ToHash() string
func (ContextSetSpec) ToSlice ¶
func (spec ContextSetSpec) ToSlice(warrantId int64) []Context
type MySQLRepository ¶
type MySQLRepository struct {
database.SQLRepository
}
func NewMySQLRepository ¶
func NewMySQLRepository(db *database.MySQL) MySQLRepository
func (MySQLRepository) DeleteAllByWarrantId ¶
func (repository MySQLRepository) DeleteAllByWarrantId(ctx context.Context, warrantId int64) error
func (MySQLRepository) ListByWarrantId ¶
Click to show internal directories.
Click to hide internal directories.