Documentation ¶
Index ¶
- Constants
- func Validate(iv *InputCommand) error
- type Command
- type DbProvider
- type InputCommand
- type Manager
- func (m *Manager) Close() error
- func (m *Manager) Create(ctx context.Context, valueToStore *InputCommand, username string) (*Command, error)
- func (m *Manager) Delete(ctx context.Context, id string) error
- func (m *Manager) GetOne(ctx context.Context, re *http.Request, id string) (*Command, bool, error)
- func (m *Manager) List(ctx context.Context, re *http.Request) ([]Command, int, error)
- func (m *Manager) Update(ctx context.Context, existingID string, valueToStore *InputCommand, ...) (*Command, error)
- type SqliteProvider
- func (p *SqliteProvider) Close() error
- func (p *SqliteProvider) Delete(ctx context.Context, id string) error
- func (p *SqliteProvider) GetByID(ctx context.Context, id string, ro *query.RetrieveOptions) (val *Command, found bool, err error)
- func (p *SqliteProvider) List(ctx context.Context, lo *query.ListOptions) ([]Command, error)
- func (p *SqliteProvider) Save(ctx context.Context, s *Command) (string, error)
Constants ¶
View Source
const DefaultTimeoutSec = 60
Variables ¶
This section is empty.
Functions ¶
func Validate ¶
func Validate(iv *InputCommand) error
Types ¶
type Command ¶
type Command struct { ID string `json:"id,omitempty" db:"id"` Name string `json:"name,omitempty" db:"name"` CreatedBy string `json:"created_by,omitempty" db:"created_by"` CreatedAt *time.Time `json:"created_at,omitempty" db:"created_at"` UpdatedBy string `json:"updated_by,omitempty" db:"updated_by"` UpdatedAt *time.Time `json:"updated_at,omitempty" db:"updated_at"` Cmd string `json:"cmd,omitempty" db:"cmd"` Tags *types.StringSlice `json:"tags,omitempty" db:"tags"` TimoutSec *int `json:"timeout_sec,omitempty" db:"timeout_sec"` }
To support sparse fieldsets, the fields that can have zero value, use pointers so they're omitted only when they're nil not when they're zero value
type DbProvider ¶
type DbProvider interface { GetByID(ctx context.Context, id string, ro *query.RetrieveOptions) (val *Command, found bool, err error) List(ctx context.Context, lo *query.ListOptions) ([]Command, error) Save(ctx context.Context, s *Command) (string, error) Delete(ctx context.Context, id string) error io.Closer }
type InputCommand ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(db DbProvider) *Manager
type SqliteProvider ¶
type SqliteProvider struct {
// contains filtered or unexported fields
}
func NewSqliteProvider ¶
func NewSqliteProvider(db *sqlx.DB) *SqliteProvider
func (*SqliteProvider) Close ¶
func (p *SqliteProvider) Close() error
func (*SqliteProvider) Delete ¶
func (p *SqliteProvider) Delete(ctx context.Context, id string) error
func (*SqliteProvider) GetByID ¶
func (p *SqliteProvider) GetByID(ctx context.Context, id string, ro *query.RetrieveOptions) (val *Command, found bool, err error)
func (*SqliteProvider) List ¶
func (p *SqliteProvider) List(ctx context.Context, lo *query.ListOptions) ([]Command, error)
Click to show internal directories.
Click to hide internal directories.