db

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module(c *di.Container)

func NewMemory

func NewMemory() *memory

Types

type CodebaseRepository

type CodebaseRepository interface {
	Create(entity codebase.Codebase) error
	Get(id string) (*codebase.Codebase, error)
	GetAllowArchived(id string) (*codebase.Codebase, error)
	GetByInviteCode(inviteCode string) (*codebase.Codebase, error)
	GetByShortID(shortID string) (*codebase.Codebase, error)
	Update(entity *codebase.Codebase) error
	ListByOrganization(ctx context.Context, organizationID string) ([]*codebase.Codebase, error)
	Count(context.Context) (uint64, error)
}

func NewRepo

func NewRepo(db *sqlx.DB) CodebaseRepository

type CodebaseUserRepository

type CodebaseUserRepository interface {
	Create(entity codebase.CodebaseUser) error
	GetByUser(userID string) ([]*codebase.CodebaseUser, error)
	GetByCodebase(codebaseID string) ([]*codebase.CodebaseUser, error)
	GetByUserAndCodebase(userID, codebaseID string) (*codebase.CodebaseUser, error)
	DeleteByID(ctx context.Context, id string) error
}

func NewCodebaseUserRepo

func NewCodebaseUserRepo(db *sqlx.DB) CodebaseUserRepository

type Repo

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

func (*Repo) Count

func (r *Repo) Count(ctx context.Context) (uint64, error)

func (*Repo) Create

func (r *Repo) Create(entity codebase.Codebase) error

func (*Repo) Get

func (r *Repo) Get(id string) (*codebase.Codebase, error)

func (*Repo) GetAllowArchived

func (r *Repo) GetAllowArchived(id string) (*codebase.Codebase, error)

func (*Repo) GetByInviteCode

func (r *Repo) GetByInviteCode(inviteCode string) (*codebase.Codebase, error)

func (*Repo) GetByShortID

func (r *Repo) GetByShortID(shortID string) (*codebase.Codebase, error)

func (*Repo) ListByOrganization

func (r *Repo) ListByOrganization(ctx context.Context, organizationID string) ([]*codebase.Codebase, error)

func (*Repo) Update

func (r *Repo) Update(entity *codebase.Codebase) error

Jump to

Keyboard shortcuts

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