dao

package
v0.0.0-...-53bcd79 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package dao contains the data access object. Generated by protoc-ddl. protoc-gen-dao: v0.1

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Desc

func Desc(opt *listOpt)

func Limit

func Limit(limit int) func(opt *listOpt)

func Sort

func Sort(col string) func(*listOpt)

Types

type ExecOption

type ExecOption func(opt *execOpt)

func WithTx

func WithTx(tx *sql.Tx) ExecOption

type ListOption

type ListOption func(opt *listOpt)

type Options

type Options struct {
	Repository        SourceRepositoryInterface
	Task              TaskInterface
	TrustedUser       TrustedUserInterface
	PermitPullRequest PermitPullRequestInterface
	TestReport        TestReportInterface

	RawConnection *sql.DB
}

func NewOptions

func NewOptions(conn *sql.DB) Options

type PermitPullRequest

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

func NewPermitPullRequest

func NewPermitPullRequest(conn *sql.DB) *PermitPullRequest

func (*PermitPullRequest) Create

func (d *PermitPullRequest) Create(ctx context.Context, permitPullRequest *database.PermitPullRequest, opt ...ExecOption) (*database.PermitPullRequest, error)

func (*PermitPullRequest) Delete

func (d *PermitPullRequest) Delete(ctx context.Context, id int32, opt ...ExecOption) error

func (*PermitPullRequest) ListByRepositoryAndNumber

func (d *PermitPullRequest) ListByRepositoryAndNumber(ctx context.Context, repository string, number int32, opt ...ListOption) ([]*database.PermitPullRequest, error)

func (*PermitPullRequest) Select

func (*PermitPullRequest) SelectMulti

func (d *PermitPullRequest) SelectMulti(ctx context.Context, id ...int32) ([]*database.PermitPullRequest, error)

func (*PermitPullRequest) Tx

func (d *PermitPullRequest) Tx(ctx context.Context, fn func(tx *sql.Tx) error) error

func (*PermitPullRequest) Update

func (d *PermitPullRequest) Update(ctx context.Context, permitPullRequest *database.PermitPullRequest, opt ...ExecOption) error

type PermitPullRequestInterface

type PermitPullRequestInterface interface {
	Tx(ctx context.Context, fn func(tx *sql.Tx) error) error
	Select(ctx context.Context, id int32) (*database.PermitPullRequest, error)
	SelectMulti(ctx context.Context, id ...int32) ([]*database.PermitPullRequest, error)
	ListByRepositoryAndNumber(ctx context.Context, repository string, number int32, opt ...ListOption) ([]*database.PermitPullRequest, error)
	Create(ctx context.Context, permitPullRequest *database.PermitPullRequest, opt ...ExecOption) (*database.PermitPullRequest, error)
	Update(ctx context.Context, permitPullRequest *database.PermitPullRequest, opt ...ExecOption) error
	Delete(ctx context.Context, id int32, opt ...ExecOption) error
}

type SourceRepository

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

func NewSourceRepository

func NewSourceRepository(conn *sql.DB) *SourceRepository

func (*SourceRepository) Create

func (d *SourceRepository) Create(ctx context.Context, sourceRepository *database.SourceRepository, opt ...ExecOption) (*database.SourceRepository, error)

func (*SourceRepository) Delete

func (d *SourceRepository) Delete(ctx context.Context, id int32, opt ...ExecOption) error

func (*SourceRepository) ListAll

func (*SourceRepository) ListByUrl

func (d *SourceRepository) ListByUrl(ctx context.Context, url string, opt ...ListOption) ([]*database.SourceRepository, error)

func (*SourceRepository) Select

func (*SourceRepository) SelectMulti

func (d *SourceRepository) SelectMulti(ctx context.Context, id ...int32) ([]*database.SourceRepository, error)

func (*SourceRepository) Tx

func (d *SourceRepository) Tx(ctx context.Context, fn func(tx *sql.Tx) error) error

func (*SourceRepository) Update

func (d *SourceRepository) Update(ctx context.Context, sourceRepository *database.SourceRepository, opt ...ExecOption) error

type SourceRepositoryInterface

type SourceRepositoryInterface interface {
	Tx(ctx context.Context, fn func(tx *sql.Tx) error) error
	Select(ctx context.Context, id int32) (*database.SourceRepository, error)
	SelectMulti(ctx context.Context, id ...int32) ([]*database.SourceRepository, error)
	ListAll(ctx context.Context, opt ...ListOption) ([]*database.SourceRepository, error)
	ListByUrl(ctx context.Context, url string, opt ...ListOption) ([]*database.SourceRepository, error)
	Create(ctx context.Context, sourceRepository *database.SourceRepository, opt ...ExecOption) (*database.SourceRepository, error)
	Update(ctx context.Context, sourceRepository *database.SourceRepository, opt ...ExecOption) error
	Delete(ctx context.Context, id int32, opt ...ExecOption) error
}

type Task

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

func NewTask

func NewTask(conn *sql.DB) *Task

func (*Task) Create

func (d *Task) Create(ctx context.Context, task *database.Task, opt ...ExecOption) (*database.Task, error)

func (*Task) Delete

func (d *Task) Delete(ctx context.Context, id int32, opt ...ExecOption) error

func (*Task) ListAll

func (d *Task) ListAll(ctx context.Context, opt ...ListOption) ([]*database.Task, error)

func (*Task) ListByRepositoryId

func (d *Task) ListByRepositoryId(ctx context.Context, repositoryId int32, opt ...ListOption) ([]*database.Task, error)

func (*Task) ListByRevision

func (d *Task) ListByRevision(ctx context.Context, repositoryId int32, revision string, opt ...ListOption) ([]*database.Task, error)

func (*Task) ListPending

func (d *Task) ListPending(ctx context.Context, opt ...ListOption) ([]*database.Task, error)

func (*Task) ListUniqJobName

func (d *Task) ListUniqJobName(ctx context.Context, repositoryId int32, opt ...ListOption) ([]*database.Task, error)

func (*Task) Select

func (d *Task) Select(ctx context.Context, id int32) (*database.Task, error)

func (*Task) SelectMulti

func (d *Task) SelectMulti(ctx context.Context, id ...int32) ([]*database.Task, error)

func (*Task) Tx

func (d *Task) Tx(ctx context.Context, fn func(tx *sql.Tx) error) error

func (*Task) Update

func (d *Task) Update(ctx context.Context, task *database.Task, opt ...ExecOption) error

type TaskInterface

type TaskInterface interface {
	Tx(ctx context.Context, fn func(tx *sql.Tx) error) error
	Select(ctx context.Context, id int32) (*database.Task, error)
	SelectMulti(ctx context.Context, id ...int32) ([]*database.Task, error)
	ListAll(ctx context.Context, opt ...ListOption) ([]*database.Task, error)
	ListByRepositoryId(ctx context.Context, repositoryId int32, opt ...ListOption) ([]*database.Task, error)
	ListPending(ctx context.Context, opt ...ListOption) ([]*database.Task, error)
	ListUniqJobName(ctx context.Context, repositoryId int32, opt ...ListOption) ([]*database.Task, error)
	ListByRevision(ctx context.Context, repositoryId int32, revision string, opt ...ListOption) ([]*database.Task, error)
	Create(ctx context.Context, task *database.Task, opt ...ExecOption) (*database.Task, error)
	Update(ctx context.Context, task *database.Task, opt ...ExecOption) error
	Delete(ctx context.Context, id int32, opt ...ExecOption) error
}

type TestReport

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

func NewTestReport

func NewTestReport(conn *sql.DB) *TestReport

func (*TestReport) Create

func (d *TestReport) Create(ctx context.Context, testReport *database.TestReport, opt ...ExecOption) (*database.TestReport, error)

func (*TestReport) Delete

func (d *TestReport) Delete(ctx context.Context, id int32, opt ...ExecOption) error

func (*TestReport) ListByTaskId

func (d *TestReport) ListByTaskId(ctx context.Context, taskId int32, opt ...ListOption) ([]*database.TestReport, error)

func (*TestReport) Select

func (d *TestReport) Select(ctx context.Context, id int32) (*database.TestReport, error)

func (*TestReport) SelectMulti

func (d *TestReport) SelectMulti(ctx context.Context, id ...int32) ([]*database.TestReport, error)

func (*TestReport) Tx

func (d *TestReport) Tx(ctx context.Context, fn func(tx *sql.Tx) error) error

func (*TestReport) Update

func (d *TestReport) Update(ctx context.Context, testReport *database.TestReport, opt ...ExecOption) error

type TestReportInterface

type TestReportInterface interface {
	Tx(ctx context.Context, fn func(tx *sql.Tx) error) error
	Select(ctx context.Context, id int32) (*database.TestReport, error)
	SelectMulti(ctx context.Context, id ...int32) ([]*database.TestReport, error)
	ListByTaskId(ctx context.Context, taskId int32, opt ...ListOption) ([]*database.TestReport, error)
	Create(ctx context.Context, testReport *database.TestReport, opt ...ExecOption) (*database.TestReport, error)
	Update(ctx context.Context, testReport *database.TestReport, opt ...ExecOption) error
	Delete(ctx context.Context, id int32, opt ...ExecOption) error
}

type TrustedUser

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

func NewTrustedUser

func NewTrustedUser(conn *sql.DB) *TrustedUser

func (*TrustedUser) Create

func (d *TrustedUser) Create(ctx context.Context, trustedUser *database.TrustedUser, opt ...ExecOption) (*database.TrustedUser, error)

func (*TrustedUser) Delete

func (d *TrustedUser) Delete(ctx context.Context, id int32, opt ...ExecOption) error

func (*TrustedUser) ListAll

func (d *TrustedUser) ListAll(ctx context.Context, opt ...ListOption) ([]*database.TrustedUser, error)

func (*TrustedUser) ListByGithubId

func (d *TrustedUser) ListByGithubId(ctx context.Context, githubId int64, opt ...ListOption) ([]*database.TrustedUser, error)

func (*TrustedUser) Select

func (d *TrustedUser) Select(ctx context.Context, id int32) (*database.TrustedUser, error)

func (*TrustedUser) SelectMulti

func (d *TrustedUser) SelectMulti(ctx context.Context, id ...int32) ([]*database.TrustedUser, error)

func (*TrustedUser) Tx

func (d *TrustedUser) Tx(ctx context.Context, fn func(tx *sql.Tx) error) error

func (*TrustedUser) Update

func (d *TrustedUser) Update(ctx context.Context, trustedUser *database.TrustedUser, opt ...ExecOption) error

type TrustedUserInterface

type TrustedUserInterface interface {
	Tx(ctx context.Context, fn func(tx *sql.Tx) error) error
	Select(ctx context.Context, id int32) (*database.TrustedUser, error)
	SelectMulti(ctx context.Context, id ...int32) ([]*database.TrustedUser, error)
	ListAll(ctx context.Context, opt ...ListOption) ([]*database.TrustedUser, error)
	ListByGithubId(ctx context.Context, githubId int64, opt ...ListOption) ([]*database.TrustedUser, error)
	Create(ctx context.Context, trustedUser *database.TrustedUser, opt ...ExecOption) (*database.TrustedUser, error)
	Update(ctx context.Context, trustedUser *database.TrustedUser, opt ...ExecOption) error
	Delete(ctx context.Context, id int32, opt ...ExecOption) error
}

Directories

Path Synopsis
Generated by protoc-ddl.
Generated by protoc-ddl.

Jump to

Keyboard shortcuts

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