repository

package
v0.0.0-...-1f1c2ef Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrInvalidInput = iota
	ErrDuplicateEntry
	ErrNotFound
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ComponentRepository

type ComponentRepository interface {
	CreateComponent(component *m.Component) error
	FindComponentByID(id uint) (*m.Component, error)
	FindComponentsByID(ids *[]uint) (*[]*m.Component, error)
	FindAllComponents() (*[]m.Component, error)
	UpdateComponent(component *m.Component) error
	DeleteComponentByID(id uint) error
}

func NewComponentRepository

func NewComponentRepository(db *gorm.DB) ComponentRepository

type IncidentRepository

type IncidentRepository interface {
	CreateIncident(
		incident *m.Incident,
		components *[]uint,
		initialLog *m.IncidentLog,
	) error

	FindIncidentByID(id uint) (*m.Incident, error)
	FindAllIncidents() (*[]m.Incident, error)

	UpdateIncident(incident *m.Incident, components *[]uint) error

	DeleteIncidentByID(id uint) error

	CreateIncidentLog(log *m.IncidentLog) error
	UpdateIncidentLog(log *m.IncidentLog) error
}

func NewIncidentRepository

func NewIncidentRepository(db *gorm.DB) IncidentRepository

type UserRepository

type UserRepository interface {
	CreateUser(user *m.User) error
	FindUserByID(id uint) (*m.User, error)
	FindUserByEmail(email string) (*m.User, error)
	FindFirstAdmin() (*m.User, error)
}

func NewUserRepository

func NewUserRepository(db *gorm.DB) UserRepository

Jump to

Keyboard shortcuts

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