Documentation ¶
Index ¶
- type DB
- func (db *DB) Create(ctx context.Context, s *Schedule) (*Schedule, error)
- func (db *DB) CreateScheduleTx(ctx context.Context, tx *sql.Tx, s *Schedule) (*Schedule, error)
- func (db *DB) Delete(ctx context.Context, id string) error
- func (db *DB) DeleteManyTx(ctx context.Context, tx *sql.Tx, ids []string) error
- func (db *DB) DeleteTx(ctx context.Context, tx *sql.Tx, id string) error
- func (db *DB) FindAll(ctx context.Context) ([]Schedule, error)
- func (db *DB) FindMany(ctx context.Context, ids []string) ([]Schedule, error)
- func (db *DB) FindOne(ctx context.Context, id string) (*Schedule, error)
- func (db *DB) FindOneForUpdate(ctx context.Context, tx *sql.Tx, id string) (*Schedule, error)
- func (db *DB) Search(ctx context.Context, opts *SearchOptions) ([]Schedule, error)
- func (db *DB) Update(ctx context.Context, s *Schedule) error
- func (db *DB) UpdateTx(ctx context.Context, tx *sql.Tx, s *Schedule) error
- type ReadStore
- type Schedule
- type SearchCursor
- type SearchOptions
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) CreateScheduleTx ¶
func (*DB) DeleteManyTx ¶
func (*DB) FindOneForUpdate ¶
type Schedule ¶
type Schedule struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` TimeZone *time.Location `json:"time_zone"` // contains filtered or unexported fields }
func (Schedule) IsUserFavorite ¶ added in v0.23.0
IsUserFavorite returns a boolean value based on if the schedule is a user favorite
type SearchCursor ¶
SearchCursor is used to indicate a position in a paginated list.
type SearchOptions ¶
type SearchOptions struct { Search string `json:"s,omitempty"` // FavoritesUserID specifies the UserID whose favorite services want to be displayed. FavoritesUserID string `json:"u,omitempty"` // FavoritesOnly controls filtering the results to those marked as favorites by FavoritesUserID. FavoritesOnly bool `json:"g,omitempty"` // FavoritesFirst indicates that services marked as favorite (by FavoritesUserID) should be returned first (before any non-favorites). FavoritesFirst bool `json:"f,omitempty"` After SearchCursor `json:"a,omitempty"` // Omit specifies a list of schedule IDs to exclude from the results. Omit []string `json:"o,omitempty"` Limit int `json:"-"` }
SearchOptions allow filtering and paginating the list of schedules.
type Store ¶
type Store interface { ReadStore Create(context.Context, *Schedule) (*Schedule, error) CreateScheduleTx(context.Context, *sql.Tx, *Schedule) (*Schedule, error) Update(context.Context, *Schedule) error UpdateTx(context.Context, *sql.Tx, *Schedule) error Delete(context.Context, string) error DeleteTx(context.Context, *sql.Tx, string) error DeleteManyTx(context.Context, *sql.Tx, []string) error FindMany(context.Context, []string) ([]Schedule, error) FindOneForUpdate(ctx context.Context, tx *sql.Tx, id string) (*Schedule, error) Search(context.Context, *SearchOptions) ([]Schedule, error) }
Click to show internal directories.
Click to hide internal directories.