db

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

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
}

DB ...

func NewDB

func NewDB(conn *gorm.DB) *DB

NewDB ...

func (*DB) CreateAccount

func (db *DB) CreateAccount(ctx context.Context, account *models.Account) error

CreateAccount ...

func (*DB) CreateOperator

func (db *DB) CreateOperator(ctx context.Context, op *models.Operator) error

CreateOperator is a method to create an operator in the database.

func (*DB) CreateSystem

func (db *DB) CreateSystem(ctx context.Context, system *models.System) error

CreateSystem ...

func (*DB) CreateTeam

func (db *DB) CreateTeam(ctx context.Context, team *authz.Team) error

CreateTeam creates a new team.

func (*DB) CreateUser

func (db *DB) CreateUser(ctx context.Context, user *models.User) error

CreateUser ...

func (*DB) DeleteOperator

func (db *DB) DeleteOperator(ctx context.Context, op *models.Operator) error

DeleteOperator ...

func (*DB) DeleteSystem

func (db *DB) DeleteSystem(ctx context.Context, id uuid.UUID) error

DeleteSystem ...

func (*DB) DeleteTeam

func (db *DB) DeleteTeam(ctx context.Context, team *authz.Team) error

DeleteTeam deletes a team by its ID.

func (*DB) DeleteUser

func (db *DB) DeleteUser(ctx context.Context, user *models.User) error

DeleteUser ...

func (*DB) GetAccount

func (db *DB) GetAccount(ctx context.Context, account *models.Account) error

GetAccount ...

func (*DB) GetOperator

func (db *DB) GetOperator(ctx context.Context, op *models.Operator) error

GetOperator is a method to get an operator from the database.

func (*DB) GetSystem

func (db *DB) GetSystem(ctx context.Context, system *models.System) error

GetSystem is returning a system by its ID.

func (*DB) GetTeam

func (db *DB) GetTeam(ctx context.Context, team *authz.Team) error

GetTeam retrieves a team by its ID.

func (*DB) GetUser

func (db *DB) GetUser(ctx context.Context, user *models.User) error

GetUser ...

func (*DB) ListAccounts

func (db *DB) ListAccounts(ctx context.Context, pagination *models.Pagination[models.Account]) error

ListAccounts ...

func (*DB) ListOperators

func (db *DB) ListOperators(ctx context.Context, pagination *models.Pagination[models.Operator]) error

ListOperators ...

func (*DB) ListSigningKeys added in v0.1.15

func (db *DB) ListSigningKeys(ctx context.Context, accountID uuid.UUID, pagination models.Pagination[models.NKey]) (models.Pagination[models.NKey], error)

ListSigningKeys ...

func (*DB) ListSystems

func (db *DB) ListSystems(ctx context.Context, pagination *models.Pagination[models.System]) error

ListSystems ...

func (*DB) ListTeams added in v0.1.15

func (db *DB) ListTeams(ctx context.Context, pagination *models.Pagination[authz.Team]) error

ListTeams retrieves all teams.

func (*DB) ListUsers

func (db *DB) ListUsers(ctx context.Context, pagination models.Pagination[models.User]) (models.Pagination[models.User], error)

ListAccounts ...

func (*DB) RunMigrations

func (db *DB) RunMigrations() error

RunMigrations ...

func (*DB) UpdateAccount

func (db *DB) UpdateAccount(ctx context.Context, account *models.Account) error

UpdateAccount ...

func (*DB) UpdateOperator

func (db *DB) UpdateOperator(ctx context.Context, op *models.Operator) error

UpdateOperator ...

func (*DB) UpdateSystem

func (db *DB) UpdateSystem(ctx context.Context, system *models.System) error

UpdateSystem ...

func (*DB) UpdateUser

func (db *DB) UpdateUser(ctx context.Context, user *models.User) error

UpdateUser ...

Jump to

Keyboard shortcuts

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