database

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID                uuid.UUID      `json:"id"`
	UserId            uuid.UUID      `json:"userId"`
	Type              string         `json:"type"`
	Provider          string         `json:"provider"`
	ProviderAccountId string         `json:"providerAccountId"`
	RefreshToken      sql.NullString `json:"refresh_token"`
	AccessToken       sql.NullString `json:"access_token"`
	ExpiresAt         sql.NullInt64  `json:"expires_at"`
	IDToken           sql.NullString `json:"id_token"`
	Scope             sql.NullString `json:"scope"`
	SessionState      sql.NullString `json:"session_state"`
	TokenType         sql.NullString `json:"token_type"`
}

type Company

type Company struct {
	ID        uuid.UUID `json:"id"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Name      string    `json:"name"`
}

type ConfigurationItem

type ConfigurationItem struct {
	ID        uuid.UUID `json:"id"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Name      string    `json:"name"`
}

type CreateCompanyParams

type CreateCompanyParams struct {
	ID        uuid.UUID `json:"id"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Name      string    `json:"name"`
}

type CreateConfigItemParams

type CreateConfigItemParams struct {
	ID        uuid.UUID `json:"id"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Name      string    `json:"name"`
}

type CreateDepartmentParams

type CreateDepartmentParams struct {
	ID          uuid.UUID      `json:"id"`
	Name        string         `json:"name"`
	Description sql.NullString `json:"description"`
	CreatedAt   sql.NullTime   `json:"created_at"`
	UpdatedAt   sql.NullTime   `json:"updated_at"`
}

type CreateIncidentParams

type CreateIncidentParams struct {
	ID               uuid.UUID      `json:"id"`
	Title            string         `json:"title"`
	ShortDescription string         `json:"short_description"`
	Description      sql.NullString `json:"description"`
	CreatedAt        time.Time      `json:"created_at"`
	UpdatedAt        time.Time      `json:"updated_at"`
}

type CreateUserParams

type CreateUserParams struct {
	ID           uuid.UUID      `json:"id"`
	CreatedAt    time.Time      `json:"created_at"`
	UpdatedAt    time.Time      `json:"updated_at"`
	FirstName    sql.NullString `json:"first_name"`
	LastName     sql.NullString `json:"last_name"`
	Email        string         `json:"email"`
	RoleID       uuid.UUID      `json:"role_id"`
	DepartmentID uuid.UUID      `json:"department_id"`
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type Department

type Department struct {
	ID          uuid.UUID      `json:"id"`
	Name        string         `json:"name"`
	Description sql.NullString `json:"description"`
	CreatedAt   sql.NullTime   `json:"created_at"`
	UpdatedAt   sql.NullTime   `json:"updated_at"`
}

type GetUserByTknRow

type GetUserByTknRow struct {
	ID            uuid.UUID      `json:"id"`
	CreatedAt     time.Time      `json:"created_at"`
	UpdatedAt     time.Time      `json:"updated_at"`
	FirstName     sql.NullString `json:"first_name"`
	LastName      sql.NullString `json:"last_name"`
	Email         string         `json:"email"`
	EmailVerified sql.NullTime   `json:"emailVerified"`
	Name          sql.NullString `json:"name"`
	Image         sql.NullString `json:"image"`
	Active        sql.NullBool   `json:"active"`
	RoleID        uuid.UUID      `json:"role_id"`
	DepartmentID  uuid.UUID      `json:"department_id"`
	ID_2          uuid.UUID      `json:"id_2"`
	UserId        uuid.UUID      `json:"userId"`
	Expires       time.Time      `json:"expires"`
	SessionToken  string         `json:"sessionToken"`
}

type GetUserRow

type GetUserRow struct {
	Active         sql.NullBool   `json:"active"`
	ID             uuid.UUID      `json:"id"`
	Email          string         `json:"email"`
	FirstName      sql.NullString `json:"first_name"`
	LastName       sql.NullString `json:"last_name"`
	RoleID         uuid.UUID      `json:"role_id"`
	RoleName       string         `json:"role_name"`
	DepartmentID   uuid.UUID      `json:"department_id"`
	DepartmentName sql.NullString `json:"department_name"`
	CreatedAt      time.Time      `json:"created_at"`
	UpdatedAt      time.Time      `json:"updated_at"`
}

type Incident

type Incident struct {
	ID               uuid.UUID      `json:"id"`
	Title            string         `json:"title"`
	ShortDescription string         `json:"short_description"`
	Description      sql.NullString `json:"description"`
	CreatedAt        time.Time      `json:"created_at"`
	UpdatedAt        time.Time      `json:"updated_at"`
}

type IncidentCategory

type IncidentCategory struct {
	ID          uuid.UUID      `json:"id"`
	Name        string         `json:"name"`
	Description sql.NullString `json:"description"`
	CreatedAt   time.Time      `json:"created_at"`
	UpdatedAt   time.Time      `json:"updated_at"`
}

type IncidentPriority

type IncidentPriority string
const (
	IncidentPriorityCritical IncidentPriority = "critical"
	IncidentPriorityHigh     IncidentPriority = "high"
	IncidentPriorityMedium   IncidentPriority = "medium"
	IncidentPriorityLow      IncidentPriority = "low"
)

func (*IncidentPriority) Scan

func (e *IncidentPriority) Scan(src interface{}) error

type IncidentStatus

type IncidentStatus string
const (
	IncidentStatusNew        IncidentStatus = "new"
	IncidentStatusAssigned   IncidentStatus = "assigned"
	IncidentStatusInProgress IncidentStatus = "in_progress"
	IncidentStatusPending    IncidentStatus = "pending"
	IncidentStatusResolved   IncidentStatus = "resolved"
	IncidentStatusClosed     IncidentStatus = "closed"
	IncidentStatusCancelled  IncidentStatus = "cancelled"
)

func (*IncidentStatus) Scan

func (e *IncidentStatus) Scan(src interface{}) error

type ListCompaniesParams

type ListCompaniesParams struct {
	Limit    int32          `json:"limit"`
	Offset   int32          `json:"offset"`
	Query    sql.NullString `json:"query"`
	OrderBy  interface{}    `json:"order_by"`
	OrderDir interface{}    `json:"order_dir"`
}

type ListCompaniesRow

type ListCompaniesRow struct {
	TotalCount int64     `json:"total_count"`
	ID         uuid.UUID `json:"id"`
	CreatedAt  time.Time `json:"created_at"`
	UpdatedAt  time.Time `json:"updated_at"`
	Name       string    `json:"name"`
}

type ListConfigItemsParams

type ListConfigItemsParams struct {
	Limit    int32          `json:"limit"`
	Offset   int32          `json:"offset"`
	Query    sql.NullString `json:"query"`
	OrderBy  interface{}    `json:"order_by"`
	OrderDir interface{}    `json:"order_dir"`
}

type ListConfigItemsRow

type ListConfigItemsRow struct {
	TotalCount int64     `json:"total_count"`
	ID         uuid.UUID `json:"id"`
	CreatedAt  time.Time `json:"created_at"`
	UpdatedAt  time.Time `json:"updated_at"`
	Name       string    `json:"name"`
}

type ListDepartmentsParams

type ListDepartmentsParams struct {
	Limit    int32          `json:"limit"`
	Offset   int32          `json:"offset"`
	Query    sql.NullString `json:"query"`
	OrderBy  interface{}    `json:"order_by"`
	OrderDir interface{}    `json:"order_dir"`
}

type ListDepartmentsRow

type ListDepartmentsRow struct {
	TotalCount  int64          `json:"total_count"`
	ID          uuid.UUID      `json:"id"`
	Name        string         `json:"name"`
	Description sql.NullString `json:"description"`
	CreatedAt   sql.NullTime   `json:"created_at"`
	UpdatedAt   sql.NullTime   `json:"updated_at"`
}

type ListIncidentsParams

type ListIncidentsParams struct {
	Limit    int32          `json:"limit"`
	Offset   int32          `json:"offset"`
	Query    sql.NullString `json:"query"`
	OrderBy  interface{}    `json:"order_by"`
	OrderDir interface{}    `json:"order_dir"`
}

type ListIncidentsRow

type ListIncidentsRow struct {
	TotalCount       int64          `json:"total_count"`
	ID               uuid.UUID      `json:"id"`
	Title            string         `json:"title"`
	ShortDescription string         `json:"short_description"`
	Description      sql.NullString `json:"description"`
	CreatedAt        time.Time      `json:"created_at"`
	UpdatedAt        time.Time      `json:"updated_at"`
}

type ListUsersParams

type ListUsersParams struct {
	Limit    int32          `json:"limit"`
	Offset   int32          `json:"offset"`
	Query    sql.NullString `json:"query"`
	OrderBy  interface{}    `json:"order_by"`
	OrderDir interface{}    `json:"order_dir"`
}

type ListUsersRow

type ListUsersRow struct {
	TotalCount     int64          `json:"total_count"`
	Active         sql.NullBool   `json:"active"`
	ID             uuid.UUID      `json:"id"`
	Email          string         `json:"email"`
	FirstName      sql.NullString `json:"first_name"`
	LastName       sql.NullString `json:"last_name"`
	RoleID         uuid.UUID      `json:"role_id"`
	RoleName       string         `json:"role_name"`
	DepartmentID   uuid.UUID      `json:"department_id"`
	DepartmentName sql.NullString `json:"department_name"`
	CreatedAt      time.Time      `json:"created_at"`
	UpdatedAt      time.Time      `json:"updated_at"`
}

type NullIncidentPriority

type NullIncidentPriority struct {
	IncidentPriority IncidentPriority `json:"incident_priority"`
	Valid            bool             `json:"valid"` // Valid is true if IncidentPriority is not NULL
}

func (*NullIncidentPriority) Scan

func (ns *NullIncidentPriority) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullIncidentPriority) Value

func (ns NullIncidentPriority) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullIncidentStatus

type NullIncidentStatus struct {
	IncidentStatus IncidentStatus `json:"incident_status"`
	Valid          bool           `json:"valid"` // Valid is true if IncidentStatus is not NULL
}

func (*NullIncidentStatus) Scan

func (ns *NullIncidentStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullIncidentStatus) Value

func (ns NullIncidentStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullStateEnum

type NullStateEnum struct {
	StateEnum StateEnum `json:"state_enum"`
	Valid     bool      `json:"valid"` // Valid is true if StateEnum is not NULL
}

func (*NullStateEnum) Scan

func (ns *NullStateEnum) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullStateEnum) Value

func (ns NullStateEnum) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Permission

type Permission struct {
	ID        uuid.UUID    `json:"id"`
	Code      string       `json:"code"`
	CreatedAt sql.NullTime `json:"created_at"`
	UpdatedAt sql.NullTime `json:"updated_at"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CountCompanies

func (q *Queries) CountCompanies(ctx context.Context, query sql.NullString) (int64, error)

func (*Queries) CountConfigItems

func (q *Queries) CountConfigItems(ctx context.Context, query sql.NullString) (int64, error)

func (*Queries) CountIncidents

func (q *Queries) CountIncidents(ctx context.Context, query sql.NullString) (int64, error)

func (*Queries) CountUsers

func (q *Queries) CountUsers(ctx context.Context, query sql.NullString) (int64, error)

func (*Queries) CreateCompany

func (q *Queries) CreateCompany(ctx context.Context, arg CreateCompanyParams) (Company, error)

func (*Queries) CreateConfigItem

func (q *Queries) CreateConfigItem(ctx context.Context, arg CreateConfigItemParams) (ConfigurationItem, error)

func (*Queries) CreateDepartment

func (q *Queries) CreateDepartment(ctx context.Context, arg CreateDepartmentParams) (Department, error)

func (*Queries) CreateIncident

func (q *Queries) CreateIncident(ctx context.Context, arg CreateIncidentParams) (Incident, error)

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)

func (*Queries) DeleteCompany

func (q *Queries) DeleteCompany(ctx context.Context, id uuid.UUID) (Company, error)

func (*Queries) DeleteConfigItem

func (q *Queries) DeleteConfigItem(ctx context.Context, id uuid.UUID) (ConfigurationItem, error)

func (*Queries) DeleteDepartment

func (q *Queries) DeleteDepartment(ctx context.Context, id uuid.UUID) (Department, error)

func (*Queries) DeleteIncident

func (q *Queries) DeleteIncident(ctx context.Context, id uuid.UUID) (Incident, error)

func (*Queries) DeleteUser

func (q *Queries) DeleteUser(ctx context.Context, id uuid.UUID) (User, error)

func (*Queries) GetCompany

func (q *Queries) GetCompany(ctx context.Context, id uuid.UUID) (Company, error)

func (*Queries) GetConfigItem

func (q *Queries) GetConfigItem(ctx context.Context, id uuid.UUID) (ConfigurationItem, error)

func (*Queries) GetDepartment

func (q *Queries) GetDepartment(ctx context.Context, id uuid.UUID) (Department, error)

func (*Queries) GetIncident

func (q *Queries) GetIncident(ctx context.Context, id uuid.UUID) (Incident, error)

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, id uuid.UUID) (GetUserRow, error)

func (*Queries) GetUserByTkn

func (q *Queries) GetUserByTkn(ctx context.Context, sessiontoken string) (GetUserByTknRow, error)

func (*Queries) ListCompanies

func (q *Queries) ListCompanies(ctx context.Context, arg ListCompaniesParams) ([]ListCompaniesRow, error)

func (*Queries) ListConfigItems

func (q *Queries) ListConfigItems(ctx context.Context, arg ListConfigItemsParams) ([]ListConfigItemsRow, error)

func (*Queries) ListDepartments

func (q *Queries) ListDepartments(ctx context.Context, arg ListDepartmentsParams) ([]ListDepartmentsRow, error)

func (*Queries) ListIncidents

func (q *Queries) ListIncidents(ctx context.Context, arg ListIncidentsParams) ([]ListIncidentsRow, error)

func (*Queries) ListUsers

func (q *Queries) ListUsers(ctx context.Context, arg ListUsersParams) ([]ListUsersRow, error)

func (*Queries) UpdateCompany

func (q *Queries) UpdateCompany(ctx context.Context, arg UpdateCompanyParams) (Company, error)

func (*Queries) UpdateConfigItem

func (q *Queries) UpdateConfigItem(ctx context.Context, arg UpdateConfigItemParams) (ConfigurationItem, error)

func (*Queries) UpdateDepartment

func (q *Queries) UpdateDepartment(ctx context.Context, arg UpdateDepartmentParams) (Department, error)

func (*Queries) UpdateIncident

func (q *Queries) UpdateIncident(ctx context.Context, arg UpdateIncidentParams) (Incident, error)

func (*Queries) UpdateUser

func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type Role

type Role struct {
	ID        uuid.UUID    `json:"id"`
	Name      string       `json:"name"`
	CreatedAt sql.NullTime `json:"created_at"`
	UpdatedAt sql.NullTime `json:"updated_at"`
}

type Service

type Service struct {
	ID          uuid.UUID      `json:"id"`
	Name        string         `json:"name"`
	Description sql.NullString `json:"description"`
	CreatedAt   time.Time      `json:"created_at"`
	UpdatedAt   time.Time      `json:"updated_at"`
}

type Session

type Session struct {
	ID           uuid.UUID `json:"id"`
	UserId       uuid.UUID `json:"userId"`
	Expires      time.Time `json:"expires"`
	SessionToken string    `json:"sessionToken"`
}

type StateEnum

type StateEnum string
const (
	StateEnumNew        StateEnum = "New"
	StateEnumInProgress StateEnum = "In Progress"
	StateEnumAssigned   StateEnum = "Assigned"
	StateEnumOnHold     StateEnum = "On Hold"
	StateEnumResolved   StateEnum = "Resolved"
)

func (*StateEnum) Scan

func (e *StateEnum) Scan(src interface{}) error

type UpdateCompanyParams

type UpdateCompanyParams struct {
	ID        uuid.UUID `json:"id"`
	UpdatedAt time.Time `json:"updated_at"`
	Name      string    `json:"name"`
}

type UpdateConfigItemParams

type UpdateConfigItemParams struct {
	ID        uuid.UUID `json:"id"`
	UpdatedAt time.Time `json:"updated_at"`
	Name      string    `json:"name"`
}

type UpdateDepartmentParams

type UpdateDepartmentParams struct {
	ID          uuid.UUID      `json:"id"`
	Name        string         `json:"name"`
	Description sql.NullString `json:"description"`
	UpdatedAt   sql.NullTime   `json:"updated_at"`
}

type UpdateIncidentParams

type UpdateIncidentParams struct {
	ID               uuid.UUID      `json:"id"`
	UpdatedAt        time.Time      `json:"updated_at"`
	Title            string         `json:"title"`
	ShortDescription string         `json:"short_description"`
	Description      sql.NullString `json:"description"`
}

type UpdateUserParams

type UpdateUserParams struct {
	ID           uuid.UUID      `json:"id"`
	UpdatedAt    time.Time      `json:"updated_at"`
	FirstName    sql.NullString `json:"first_name"`
	LastName     sql.NullString `json:"last_name"`
	Email        string         `json:"email"`
	RoleID       uuid.UUID      `json:"role_id"`
	DepartmentID uuid.UUID      `json:"department_id"`
}

type User

type User struct {
	ID            uuid.UUID      `json:"id"`
	CreatedAt     time.Time      `json:"created_at"`
	UpdatedAt     time.Time      `json:"updated_at"`
	FirstName     sql.NullString `json:"first_name"`
	LastName      sql.NullString `json:"last_name"`
	Email         string         `json:"email"`
	EmailVerified sql.NullTime   `json:"emailVerified"`
	Name          sql.NullString `json:"name"`
	Image         sql.NullString `json:"image"`
	Active        sql.NullBool   `json:"active"`
	RoleID        uuid.UUID      `json:"role_id"`
	DepartmentID  uuid.UUID      `json:"department_id"`
}

type UsersPermission

type UsersPermission struct {
	UserID       uuid.UUID `json:"user_id"`
	PermissionID uuid.UUID `json:"permission_id"`
}

type VerificationToken

type VerificationToken struct {
	Identifier string    `json:"identifier"`
	Expires    time.Time `json:"expires"`
	Token      string    `json:"token"`
}

Jump to

Keyboard shortcuts

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