Documentation ¶
Index ¶
- type CompanyRepository
- type ConfigItemRepository
- type IncidentRepository
- type Repositories
- type SQLCompanyRepository
- func (r *SQLCompanyRepository) Create(ctx context.Context, company models.Company) (models.Company, error)
- func (r *SQLCompanyRepository) Delete(ctx context.Context, id uuid.UUID) (models.Company, error)
- func (r *SQLCompanyRepository) Get(ctx context.Context, id uuid.UUID) (models.Company, error)
- func (r *SQLCompanyRepository) List(ctx context.Context, query string, filters models.Filters) ([]models.Company, models.Metadata, error)
- func (r *SQLCompanyRepository) Update(ctx context.Context, company models.Company) (models.Company, error)
- type SQLConfigItemRepository
- func (r *SQLConfigItemRepository) Create(ctx context.Context, ci models.ConfigItem) (models.ConfigItem, error)
- func (r *SQLConfigItemRepository) Delete(ctx context.Context, id uuid.UUID) (models.ConfigItem, error)
- func (r *SQLConfigItemRepository) Get(ctx context.Context, id uuid.UUID) (models.ConfigItem, error)
- func (r *SQLConfigItemRepository) List(ctx context.Context, query string, filters models.Filters) ([]models.ConfigItem, models.Metadata, error)
- func (r *SQLConfigItemRepository) Update(ctx context.Context, ci models.ConfigItem) (models.ConfigItem, error)
- type SQLIncidentRepository
- func (r *SQLIncidentRepository) Create(ctx context.Context, incident models.Incident) (models.Incident, error)
- func (r *SQLIncidentRepository) Delete(ctx context.Context, id uuid.UUID) (models.Incident, error)
- func (r *SQLIncidentRepository) Get(ctx context.Context, id uuid.UUID) (models.Incident, error)
- func (r *SQLIncidentRepository) List(ctx context.Context, query string, filters models.Filters) ([]models.Incident, models.Metadata, error)
- func (r *SQLIncidentRepository) Update(ctx context.Context, incident models.Incident) (models.Incident, error)
- type SQLUserRepository
- func (r *SQLUserRepository) Create(ctx context.Context, user models.User) (models.User, error)
- func (r *SQLUserRepository) Delete(ctx context.Context, id uuid.UUID) (models.User, error)
- func (r *SQLUserRepository) Get(ctx context.Context, id uuid.UUID) (models.User, error)
- func (r *SQLUserRepository) List(ctx context.Context, query string, filters models.Filters) ([]models.User, models.Metadata, error)
- func (r *SQLUserRepository) Update(ctx context.Context, user models.User) (models.User, error)
- type UserRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompanyRepository ¶
type CompanyRepository interface { List(tx context.Context, query string, filters models.Filters) ([]models.Company, models.Metadata, error) Get(ctx context.Context, id uuid.UUID) (models.Company, error) Create(ctx context.Context, company models.Company) (models.Company, error) Update(ctx context.Context, company models.Company) (models.Company, error) Delete(ctx context.Context, id uuid.UUID) (models.Company, error) }
func NewCompanyRepository ¶
func NewCompanyRepository(logger *slog.Logger, db *database.Queries, timeProvider models.TimeProvider) CompanyRepository
type ConfigItemRepository ¶
type ConfigItemRepository interface { List(tx context.Context, query string, filters models.Filters) ([]models.ConfigItem, models.Metadata, error) Get(ctx context.Context, id uuid.UUID) (models.ConfigItem, error) Create(ctx context.Context, ci models.ConfigItem) (models.ConfigItem, error) Update(ctx context.Context, ci models.ConfigItem) (models.ConfigItem, error) Delete(ctx context.Context, id uuid.UUID) (models.ConfigItem, error) }
func NewConfigItemRepository ¶
func NewConfigItemRepository(logger *slog.Logger, db *database.Queries, timeProvider models.TimeProvider) ConfigItemRepository
type IncidentRepository ¶
type IncidentRepository interface { List(tx context.Context, query string, filters models.Filters) ([]models.Incident, models.Metadata, error) Get(ctx context.Context, id uuid.UUID) (models.Incident, error) Create(ctx context.Context, incident models.Incident) (models.Incident, error) Update(ctx context.Context, incident models.Incident) (models.Incident, error) Delete(ctx context.Context, id uuid.UUID) (models.Incident, error) }
func NewIncidentRepository ¶
func NewIncidentRepository(logger *slog.Logger, db *database.Queries, timeProvider models.TimeProvider) IncidentRepository
type Repositories ¶
type Repositories struct { User UserRepository Incident IncidentRepository Company CompanyRepository ConfigItem ConfigItemRepository }
Repositories holds all repository instances
func NewRepositories ¶
func NewRepositories(logger *slog.Logger, db *database.Queries, timeProvider models.TimeProvider) *Repositories
Construct all repositories
type SQLCompanyRepository ¶
type SQLCompanyRepository struct {
// contains filtered or unexported fields
}
func (*SQLCompanyRepository) Create ¶
func (r *SQLCompanyRepository) Create(ctx context.Context, company models.Company) (models.Company, error)
CreateCompany implements CompanyRepository.
type SQLConfigItemRepository ¶
type SQLConfigItemRepository struct {
// contains filtered or unexported fields
}
func (*SQLConfigItemRepository) Create ¶
func (r *SQLConfigItemRepository) Create(ctx context.Context, ci models.ConfigItem) (models.ConfigItem, error)
CreateConfigItem implements ConfigItemRepository.
func (*SQLConfigItemRepository) Delete ¶
func (r *SQLConfigItemRepository) Delete(ctx context.Context, id uuid.UUID) (models.ConfigItem, error)
DeleteConfigItem implements ConfigItemRepository.
func (*SQLConfigItemRepository) Get ¶
func (r *SQLConfigItemRepository) Get(ctx context.Context, id uuid.UUID) (models.ConfigItem, error)
GetConfigItem implements ConfigItemRepository.
func (*SQLConfigItemRepository) List ¶
func (r *SQLConfigItemRepository) List(ctx context.Context, query string, filters models.Filters) ([]models.ConfigItem, models.Metadata, error)
ListConfigItems implements ConfigItemRepository.
func (*SQLConfigItemRepository) Update ¶
func (r *SQLConfigItemRepository) Update(ctx context.Context, ci models.ConfigItem) (models.ConfigItem, error)
UpdateConfigItem implements ConfigItemRepository.
type SQLIncidentRepository ¶
type SQLIncidentRepository struct {
// contains filtered or unexported fields
}
func (*SQLIncidentRepository) Create ¶
func (r *SQLIncidentRepository) Create(ctx context.Context, incident models.Incident) (models.Incident, error)
CreateIncident implements IncidentRepository.
type SQLUserRepository ¶
type SQLUserRepository struct {
// contains filtered or unexported fields
}
type UserRepository ¶
type UserRepository interface { List(tx context.Context, query string, filters models.Filters) ([]models.User, models.Metadata, error) Get(ctx context.Context, id uuid.UUID) (models.User, error) // GetByToken(ctx context.Context, token string) (models.User, error) Create(ctx context.Context, user models.User) (models.User, error) Update(ctx context.Context, user models.User) (models.User, error) Delete(ctx context.Context, id uuid.UUID) (models.User, error) }
Repository interfaces
func NewUserRepository ¶
func NewUserRepository(logger *slog.Logger, db *database.Queries, timeProvider models.TimeProvider) UserRepository
Click to show internal directories.
Click to hide internal directories.