Documentation ¶
Index ¶
- type DB
- func (db *DB) CreateServiceTx(ctx context.Context, tx *sql.Tx, s *Service) (*Service, 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) ([]Service, error)
- func (db *DB) FindAllByEP(ctx context.Context, epID string) ([]Service, error)
- func (db *DB) FindMany(ctx context.Context, ids []string) ([]Service, error)
- func (db *DB) FindOne(ctx context.Context, id string) (*Service, error)
- func (db *DB) FindOneForUpdate(ctx context.Context, tx *sql.Tx, id string) (*Service, error)
- func (db *DB) FindOneForUser(ctx context.Context, userID, serviceID string) (*Service, error)
- func (db *DB) Insert(ctx context.Context, s *Service) (*Service, error)
- func (db *DB) LegacySearch(ctx context.Context, opts *LegacySearchOptions) ([]Service, error)
- func (db *DB) Search(ctx context.Context, opts *SearchOptions) ([]Service, error)
- func (db *DB) Update(ctx context.Context, s *Service) error
- func (db *DB) UpdateTx(ctx context.Context, tx *sql.Tx, s *Service) error
- type LegacySearchOptions
- type SearchCursor
- type SearchOptions
- type Service
- 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) CreateServiceTx ¶
func (*DB) DeleteManyTx ¶
func (*DB) FindAllByEP ¶
func (*DB) FindOneForUpdate ¶
func (*DB) FindOneForUser ¶
func (*DB) LegacySearch ¶
LegacySearch will return a list of matching services and the total number of matches available.
func (*DB) Search ¶
Search will return a list of matching services and the total number of matches available.
type LegacySearchOptions ¶
type LegacySearchOptions struct { // Search is matched case-insensitive against the service name and description. Search string // FavoritesUserID specifies the UserID whose favorite services want to be displayed. FavoritesUserID string // FavoritesOnly controls filtering the results to those marked as favorites by FavoritesUserID. FavoritesOnly bool // FavoritesFirst indicates that services marked as favorite (by FavoritesUserID) should be returned first (before any non-favorites). FavoritesFirst bool // Limit, if not zero, will limit the number of results. Limit int }
LegacySearchOptions contains criteria for filtering and sorting services.
type SearchCursor ¶
type SearchOptions ¶
type SearchOptions struct { // Search is matched case-insensitive against the service name and description. 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:"o,omitempty"` // Omit specifies a list of service IDs to exclude from the results. Omit []string `json:"m,omitempty"` // FavoritesFirst indicates that services marked as favorite (by FavoritesUserID) should be returned first (before any non-favorites). FavoritesFirst bool `json:"f,omitempty"` // Limit will limit the number of results. Limit int `json:"-"` After SearchCursor `json:"a,omitempty"` }
SearchOptions contains criteria for filtering and sorting services.
type Service ¶
type Service struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` EscalationPolicyID string `json:"escalation_policy_id"` // contains filtered or unexported fields }
func (Service) EscalationPolicyName ¶
func (Service) IsUserFavorite ¶
IsUserFavorite returns a boolean value based on if the service is a favorite of the user or not.
type Store ¶
type Store interface { FindMany(context.Context, []string) ([]Service, error) FindOne(context.Context, string) (*Service, error) FindOneForUpdate(ctx context.Context, tx *sql.Tx, id string) (*Service, error) FindOneForUser(ctx context.Context, userID, serviceID string) (*Service, error) FindAll(context.Context) ([]Service, error) DeleteManyTx(context.Context, *sql.Tx, []string) error Insert(context.Context, *Service) (*Service, error) CreateServiceTx(context.Context, *sql.Tx, *Service) (*Service, error) Update(context.Context, *Service) error UpdateTx(context.Context, *sql.Tx, *Service) error Delete(ctx context.Context, id string) error DeleteTx(ctx context.Context, tx *sql.Tx, id string) error FindAllByEP(context.Context, string) ([]Service, error) LegacySearch(ctx context.Context, opts *LegacySearchOptions) ([]Service, error) Search(ctx context.Context, opts *SearchOptions) ([]Service, error) }
Click to show internal directories.
Click to hide internal directories.