repository

package
v0.0.0-...-e705344 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

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

CreateCompany implements CompanyRepository.

func (*SQLCompanyRepository) Delete

DeleteCompany implements CompanyRepository.

func (*SQLCompanyRepository) Get

GetCompany implements CompanyRepository.

func (*SQLCompanyRepository) List

ListCompanies implements CompanyRepository.

func (*SQLCompanyRepository) Update

UpdateCompany implements CompanyRepository.

type SQLConfigItemRepository

type SQLConfigItemRepository struct {
	// contains filtered or unexported fields
}

func (*SQLConfigItemRepository) Create

CreateConfigItem implements ConfigItemRepository.

func (*SQLConfigItemRepository) Delete

DeleteConfigItem implements ConfigItemRepository.

func (*SQLConfigItemRepository) Get

GetConfigItem implements ConfigItemRepository.

func (*SQLConfigItemRepository) List

ListConfigItems implements ConfigItemRepository.

func (*SQLConfigItemRepository) Update

UpdateConfigItem implements ConfigItemRepository.

type SQLIncidentRepository

type SQLIncidentRepository struct {
	// contains filtered or unexported fields
}

func (*SQLIncidentRepository) Create

CreateIncident implements IncidentRepository.

func (*SQLIncidentRepository) Delete

DeleteIncident implements IncidentRepository.

func (*SQLIncidentRepository) Get

GetIncident implements IncidentRepository.

func (*SQLIncidentRepository) List

ListIncidents implements IncidentRepository.

func (*SQLIncidentRepository) Update

UpdateIncident implements IncidentRepository.

type SQLUserRepository

type SQLUserRepository struct {
	// contains filtered or unexported fields
}

func (*SQLUserRepository) Create

func (r *SQLUserRepository) Create(ctx context.Context, user models.User) (models.User, error)

CreateUser implements UserRepository.

func (*SQLUserRepository) Delete

func (r *SQLUserRepository) Delete(ctx context.Context, id uuid.UUID) (models.User, error)

DeleteUser implements UserRepository.

func (*SQLUserRepository) Get

GetUser implements UserRepository.

func (*SQLUserRepository) List

func (r *SQLUserRepository) List(ctx context.Context, query string, filters models.Filters) ([]models.User, models.Metadata, error)

ListUsers implements UserRepository.

func (*SQLUserRepository) Update

func (r *SQLUserRepository) Update(ctx context.Context, user models.User) (models.User, error)

UpdateUser implements UserRepository.

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL