dbrepo

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2025 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerRepo

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

func NewContainerRepo

func NewContainerRepo(ctx context.Context, db *sql.DB, l log.Writer) *ContainerRepo

func (*ContainerRepo) AllocatePort

func (r *ContainerRepo) AllocatePort(containerID string, port int) error

func (*ContainerRepo) Create

func (r *ContainerRepo) Create(container *model.Container) (*model.Container, error)

func (*ContainerRepo) Delete

func (r *ContainerRepo) Delete(id string) error

func (*ContainerRepo) FillPorts

func (r *ContainerRepo) FillPorts(minPort, maxPort int) error

func (*ContainerRepo) GetAll

func (r *ContainerRepo) GetAll() ([]model.Container, error)

func (*ContainerRepo) GetByID

func (r *ContainerRepo) GetByID(id string) (*model.Container, error)

func (*ContainerRepo) GetFreePort

func (r *ContainerRepo) GetFreePort() (int, error)

func (*ContainerRepo) GetPortCount

func (r *ContainerRepo) GetPortCount() (int, error)

func (*ContainerRepo) ReleasePort

func (r *ContainerRepo) ReleasePort(containerID string) error

func (*ContainerRepo) Update

func (r *ContainerRepo) Update(container *model.Container) (*model.Container, error)

type TemplateRepo

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

func NewTemplateRepo

func NewTemplateRepo(ctx context.Context, db *sql.DB, l log.Writer) *TemplateRepo

func (*TemplateRepo) Create

func (r *TemplateRepo) Create(template *model.Template) (*model.Template, error)

func (*TemplateRepo) Delete

func (r *TemplateRepo) Delete(id string) error

func (*TemplateRepo) GetAll

func (r *TemplateRepo) GetAll() ([]*model.Template, error)

func (*TemplateRepo) GetByID

func (r *TemplateRepo) GetByID(id string) (*model.Template, error)

func (*TemplateRepo) Update

func (r *TemplateRepo) Update(template *model.Template) (*model.Template, error)

type TokenRepo

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

func NewTokenRepo

func NewTokenRepo(ctx context.Context, db *sql.DB, l log.Writer) *TokenRepo

func (*TokenRepo) Create

func (r *TokenRepo) Create(token *model.Token) (*model.Token, error)

func (*TokenRepo) Delete

func (r *TokenRepo) Delete(token string) error

func (*TokenRepo) Get

func (r *TokenRepo) Get(tokenKey string) (*model.Token, error)

func (*TokenRepo) GetByUserID

func (r *TokenRepo) GetByUserID(userID string) ([]*model.Token, error)

type UserRepo

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

func NewUserRepo

func NewUserRepo(ctx context.Context, db *sql.DB, l log.Writer) *UserRepo

func (*UserRepo) Create

func (r *UserRepo) Create(user *model.User) (*model.User, error)

func (*UserRepo) Delete

func (r *UserRepo) Delete(id string) error

func (*UserRepo) GetAll

func (r *UserRepo) GetAll() ([]*model.User, error)

func (*UserRepo) GetByID

func (r *UserRepo) GetByID(id string) (*model.User, error)

func (*UserRepo) GetUnsafeByUsername

func (r *UserRepo) GetUnsafeByUsername(username string) (*model.User, error)

func (*UserRepo) GetUserByToken

func (r *UserRepo) GetUserByToken(token string) (*model.User, error)

func (*UserRepo) Update

func (r *UserRepo) Update(user *model.User) error

Jump to

Keyboard shortcuts

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