dao

package
v0.13.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

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)

Types

type AccessToken

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

func NewAccessToken

func NewAccessToken(conn *sql.DB) *AccessToken

func (*AccessToken) Create

func (d *AccessToken) Create(ctx context.Context, accessToken *entity.AccessToken, opt ...ExecOption) (*entity.AccessToken, error)

func (*AccessToken) Delete

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

func (*AccessToken) ListByUser

func (d *AccessToken) ListByUser(ctx context.Context, userId int32, opt ...ListOption) ([]*entity.AccessToken, error)

func (*AccessToken) Select

func (d *AccessToken) Select(ctx context.Context, id int32) (*entity.AccessToken, error)

func (*AccessToken) SelectAccessToken

func (d *AccessToken) SelectAccessToken(ctx context.Context, value string) (*entity.AccessToken, error)

func (*AccessToken) Tx

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

func (*AccessToken) Update

func (d *AccessToken) Update(ctx context.Context, accessToken *entity.AccessToken, opt ...ExecOption) error

type AccessTokenInterface added in v0.11.0

type AccessTokenInterface interface {
	Tx(ctx context.Context, fn func(tx *sql.Tx) error) error
	Select(ctx context.Context, id int32) (*entity.AccessToken, error)
	SelectAccessToken(ctx context.Context, value string) (*entity.AccessToken, error)
	ListByUser(ctx context.Context, userId int32, opt ...ListOption) ([]*entity.AccessToken, error)
	Create(ctx context.Context, accessToken *entity.AccessToken, opt ...ExecOption) (*entity.AccessToken, error)
	Update(ctx context.Context, accessToken *entity.AccessToken, opt ...ExecOption) error
	Delete(ctx context.Context, id int32, opt ...ExecOption) error
}

type Code

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

func NewCode

func NewCode(conn *sql.DB) *Code

func (*Code) Create

func (d *Code) Create(ctx context.Context, code *entity.Code, opt ...ExecOption) (*entity.Code, error)

func (*Code) Delete

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

func (*Code) ListAll

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

func (*Code) Select

func (d *Code) Select(ctx context.Context, id int32) (*entity.Code, error)

func (*Code) SelectCode

func (d *Code) SelectCode(ctx context.Context, code string) (*entity.Code, error)

func (*Code) Tx

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

func (*Code) Update

func (d *Code) Update(ctx context.Context, code *entity.Code, opt ...ExecOption) error

type CodeInterface added in v0.11.0

type CodeInterface interface {
	Tx(ctx context.Context, fn func(tx *sql.Tx) error) error
	Select(ctx context.Context, id int32) (*entity.Code, error)
	SelectCode(ctx context.Context, code string) (*entity.Code, error)
	ListAll(ctx context.Context, opt ...ListOption) ([]*entity.Code, error)
	Create(ctx context.Context, code *entity.Code, opt ...ExecOption) (*entity.Code, error)
	Update(ctx context.Context, code *entity.Code, opt ...ExecOption) error
	Delete(ctx context.Context, id int32, opt ...ExecOption) error
}

type ExecOption

type ExecOption func(opt *execOpt)

func WithTx

func WithTx(tx *sql.Tx) ExecOption

type ListOption

type ListOption func(opt *listOpt)

type Node

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

func NewNode

func NewNode(conn *sql.DB) *Node

func (*Node) Create

func (d *Node) Create(ctx context.Context, node *entity.Node, opt ...ExecOption) (*entity.Node, error)

func (*Node) Delete

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

func (*Node) ListAll

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

func (*Node) ListHostname

func (d *Node) ListHostname(ctx context.Context, hostname string, opt ...ListOption) ([]*entity.Node, error)

func (*Node) Select

func (d *Node) Select(ctx context.Context, id int32) (*entity.Node, error)

func (*Node) Tx

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

func (*Node) Update

func (d *Node) Update(ctx context.Context, node *entity.Node, opt ...ExecOption) error

type NodeInterface added in v0.11.0

type NodeInterface interface {
	Tx(ctx context.Context, fn func(tx *sql.Tx) error) error
	Select(ctx context.Context, id int32) (*entity.Node, error)
	ListAll(ctx context.Context, opt ...ListOption) ([]*entity.Node, error)
	ListHostname(ctx context.Context, hostname string, opt ...ListOption) ([]*entity.Node, error)
	Create(ctx context.Context, node *entity.Node, opt ...ExecOption) (*entity.Node, error)
	Update(ctx context.Context, node *entity.Node, opt ...ExecOption) error
	Delete(ctx context.Context, id int32, opt ...ExecOption) error
}

type Relay

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

func NewRelay

func NewRelay(conn *sql.DB) *Relay

func (*Relay) Create

func (d *Relay) Create(ctx context.Context, relay *entity.Relay, opt ...ExecOption) (*entity.Relay, error)

func (*Relay) Delete

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

func (*Relay) ListAll

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

func (*Relay) ListName

func (d *Relay) ListName(ctx context.Context, name string, opt ...ListOption) ([]*entity.Relay, error)

func (*Relay) Select

func (d *Relay) Select(ctx context.Context, id int32) (*entity.Relay, error)

func (*Relay) SelectEndpoint

func (d *Relay) SelectEndpoint(ctx context.Context, name string, addr string) (*entity.Relay, error)

func (*Relay) Tx

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

func (*Relay) Update

func (d *Relay) Update(ctx context.Context, relay *entity.Relay, opt ...ExecOption) error

type RelayInterface added in v0.11.0

type RelayInterface interface {
	Tx(ctx context.Context, fn func(tx *sql.Tx) error) error
	Select(ctx context.Context, id int32) (*entity.Relay, error)
	ListName(ctx context.Context, name string, opt ...ListOption) ([]*entity.Relay, error)
	SelectEndpoint(ctx context.Context, name string, addr string) (*entity.Relay, error)
	ListAll(ctx context.Context, opt ...ListOption) ([]*entity.Relay, error)
	Create(ctx context.Context, relay *entity.Relay, opt ...ExecOption) (*entity.Relay, error)
	Update(ctx context.Context, relay *entity.Relay, opt ...ExecOption) error
	Delete(ctx context.Context, id int32, opt ...ExecOption) error
}

type Repository

type Repository struct {
	Conn               *sql.DB
	SerialNumber       *SerialNumber
	SignedCertificate  *SignedCertificate
	RevokedCertificate *RevokedCertificate
	Node               *Node
	Relay              *Relay
	Token              *Token
	Code               *Code
	User               *User
	UserState          *UserState
	RoleBinding        *RoleBinding
	AccessToken        *AccessToken
}

func NewRepository

func NewRepository(conn *sql.DB) *Repository

type RevokedCertificate

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

func NewRevokedCertificate

func NewRevokedCertificate(conn *sql.DB) *RevokedCertificate

func (*RevokedCertificate) Create

func (d *RevokedCertificate) Create(ctx context.Context, revokedCertificate *entity.RevokedCertificate, opt ...ExecOption) (*entity.RevokedCertificate, error)

func (*RevokedCertificate) Delete

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

func (*RevokedCertificate) ListAll

func (*RevokedCertificate) ListSerialNumber

func (d *RevokedCertificate) ListSerialNumber(ctx context.Context, serialNumber []byte, opt ...ListOption) ([]*entity.RevokedCertificate, error)

func (*RevokedCertificate) Select

func (*RevokedCertificate) Tx

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

func (*RevokedCertificate) Update

func (d *RevokedCertificate) Update(ctx context.Context, revokedCertificate *entity.RevokedCertificate, opt ...ExecOption) error

type RevokedCertificateInterface added in v0.11.0

type RevokedCertificateInterface interface {
	Tx(ctx context.Context, fn func(tx *sql.Tx) error) error
	Select(ctx context.Context, id int32) (*entity.RevokedCertificate, error)
	ListSerialNumber(ctx context.Context, serialNumber []byte, opt ...ListOption) ([]*entity.RevokedCertificate, error)
	ListAll(ctx context.Context, opt ...ListOption) ([]*entity.RevokedCertificate, error)
	Create(ctx context.Context, revokedCertificate *entity.RevokedCertificate, opt ...ExecOption) (*entity.RevokedCertificate, error)
	Update(ctx context.Context, revokedCertificate *entity.RevokedCertificate, opt ...ExecOption) error
	Delete(ctx context.Context, id int32, opt ...ExecOption) error
}

type RoleBinding

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

func NewRoleBinding

func NewRoleBinding(conn *sql.DB) *RoleBinding

func (*RoleBinding) Create

func (d *RoleBinding) Create(ctx context.Context, roleBinding *entity.RoleBinding, opt ...ExecOption) (*entity.RoleBinding, error)

func (*RoleBinding) Delete

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

func (*RoleBinding) ListAll

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

func (*RoleBinding) ListUser

func (d *RoleBinding) ListUser(ctx context.Context, userId int32, opt ...ListOption) ([]*entity.RoleBinding, error)

func (*RoleBinding) Select

func (d *RoleBinding) Select(ctx context.Context, id int32) (*entity.RoleBinding, error)

func (*RoleBinding) SelectUserRole

func (d *RoleBinding) SelectUserRole(ctx context.Context, userId int32, role string) (*entity.RoleBinding, error)

func (*RoleBinding) Tx

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

func (*RoleBinding) Update

func (d *RoleBinding) Update(ctx context.Context, roleBinding *entity.RoleBinding, opt ...ExecOption) error

type RoleBindingInterface added in v0.11.0

type RoleBindingInterface interface {
	Tx(ctx context.Context, fn func(tx *sql.Tx) error) error
	Select(ctx context.Context, id int32) (*entity.RoleBinding, error)
	ListUser(ctx context.Context, userId int32, opt ...ListOption) ([]*entity.RoleBinding, error)
	ListAll(ctx context.Context, opt ...ListOption) ([]*entity.RoleBinding, error)
	SelectUserRole(ctx context.Context, userId int32, role string) (*entity.RoleBinding, error)
	Create(ctx context.Context, roleBinding *entity.RoleBinding, opt ...ExecOption) (*entity.RoleBinding, error)
	Update(ctx context.Context, roleBinding *entity.RoleBinding, opt ...ExecOption) error
	Delete(ctx context.Context, id int32, opt ...ExecOption) error
}

type SerialNumber

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

func NewSerialNumber

func NewSerialNumber(conn *sql.DB) *SerialNumber

func (*SerialNumber) Create

func (d *SerialNumber) Create(ctx context.Context, serialNumber *entity.SerialNumber, opt ...ExecOption) (*entity.SerialNumber, error)

func (*SerialNumber) Delete

func (d *SerialNumber) Delete(ctx context.Context, id int64, opt ...ExecOption) error

func (*SerialNumber) Select

func (d *SerialNumber) Select(ctx context.Context, id int64) (*entity.SerialNumber, error)

func (*SerialNumber) SelectSerialNumber

func (d *SerialNumber) SelectSerialNumber(ctx context.Context, serialNumber []byte) (*entity.SerialNumber, error)

func (*SerialNumber) Tx

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

func (*SerialNumber) Update

func (d *SerialNumber) Update(ctx context.Context, serialNumber *entity.SerialNumber, opt ...ExecOption) error

type SerialNumberInterface added in v0.11.0

type SerialNumberInterface interface {
	Tx(ctx context.Context, fn func(tx *sql.Tx) error) error
	Select(ctx context.Context, id int64) (*entity.SerialNumber, error)
	SelectSerialNumber(ctx context.Context, serialNumber []byte) (*entity.SerialNumber, error)
	Create(ctx context.Context, serialNumber *entity.SerialNumber, opt ...ExecOption) (*entity.SerialNumber, error)
	Update(ctx context.Context, serialNumber *entity.SerialNumber, opt ...ExecOption) error
	Delete(ctx context.Context, id int64, opt ...ExecOption) error
}

type SignedCertificate

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

func NewSignedCertificate

func NewSignedCertificate(conn *sql.DB) *SignedCertificate

func (*SignedCertificate) Create

func (d *SignedCertificate) Create(ctx context.Context, signedCertificate *entity.SignedCertificate, opt ...ExecOption) (*entity.SignedCertificate, error)

func (*SignedCertificate) Delete

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

func (*SignedCertificate) ListAll

func (*SignedCertificate) ListSerialNumber

func (d *SignedCertificate) ListSerialNumber(ctx context.Context, serialNumberId int64, opt ...ListOption) ([]*entity.SignedCertificate, error)

func (*SignedCertificate) Select

func (*SignedCertificate) Tx

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

func (*SignedCertificate) Update

func (d *SignedCertificate) Update(ctx context.Context, signedCertificate *entity.SignedCertificate, opt ...ExecOption) error

type SignedCertificateInterface added in v0.11.0

type SignedCertificateInterface interface {
	Tx(ctx context.Context, fn func(tx *sql.Tx) error) error
	Select(ctx context.Context, id int32) (*entity.SignedCertificate, error)
	ListSerialNumber(ctx context.Context, serialNumberId int64, opt ...ListOption) ([]*entity.SignedCertificate, error)
	ListAll(ctx context.Context, opt ...ListOption) ([]*entity.SignedCertificate, error)
	Create(ctx context.Context, signedCertificate *entity.SignedCertificate, opt ...ExecOption) (*entity.SignedCertificate, error)
	Update(ctx context.Context, signedCertificate *entity.SignedCertificate, opt ...ExecOption) error
	Delete(ctx context.Context, id int32, opt ...ExecOption) error
}

type Token

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

func NewToken

func NewToken(conn *sql.DB) *Token

func (*Token) Create

func (d *Token) Create(ctx context.Context, token *entity.Token, opt ...ExecOption) (*entity.Token, error)

func (*Token) Delete

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

func (*Token) ListAll

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

func (*Token) ListToken

func (d *Token) ListToken(ctx context.Context, token string, opt ...ListOption) ([]*entity.Token, error)

func (*Token) Select

func (d *Token) Select(ctx context.Context, id int32) (*entity.Token, error)

func (*Token) Tx

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

func (*Token) Update

func (d *Token) Update(ctx context.Context, token *entity.Token, opt ...ExecOption) error

type TokenInterface added in v0.11.0

type TokenInterface interface {
	Tx(ctx context.Context, fn func(tx *sql.Tx) error) error
	Select(ctx context.Context, id int32) (*entity.Token, error)
	ListAll(ctx context.Context, opt ...ListOption) ([]*entity.Token, error)
	ListToken(ctx context.Context, token string, opt ...ListOption) ([]*entity.Token, error)
	Create(ctx context.Context, token *entity.Token, opt ...ExecOption) (*entity.Token, error)
	Update(ctx context.Context, token *entity.Token, opt ...ExecOption) error
	Delete(ctx context.Context, id int32, opt ...ExecOption) error
}

type User

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

func NewUser

func NewUser(conn *sql.DB) *User

func (*User) Create

func (d *User) Create(ctx context.Context, user *entity.User, opt ...ExecOption) (*entity.User, error)

func (*User) Delete

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

func (*User) ListAll

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

func (*User) ListIdentityByLoginName added in v0.10.0

func (d *User) ListIdentityByLoginName(ctx context.Context, loginName string, opt ...ListOption) ([]*entity.User, error)

func (*User) Select

func (d *User) Select(ctx context.Context, id int32) (*entity.User, error)

func (*User) SelectIdentity

func (d *User) SelectIdentity(ctx context.Context, identity string) (*entity.User, error)

func (*User) Tx

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

func (*User) Update

func (d *User) Update(ctx context.Context, user *entity.User, opt ...ExecOption) error

type UserInterface added in v0.11.0

type UserInterface interface {
	Tx(ctx context.Context, fn func(tx *sql.Tx) error) error
	Select(ctx context.Context, id int32) (*entity.User, error)
	SelectIdentity(ctx context.Context, identity string) (*entity.User, error)
	ListIdentityByLoginName(ctx context.Context, loginName string, opt ...ListOption) ([]*entity.User, error)
	ListAll(ctx context.Context, opt ...ListOption) ([]*entity.User, error)
	Create(ctx context.Context, user *entity.User, opt ...ExecOption) (*entity.User, error)
	Update(ctx context.Context, user *entity.User, opt ...ExecOption) error
	Delete(ctx context.Context, id int32, opt ...ExecOption) error
}

type UserState

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

func NewUserState

func NewUserState(conn *sql.DB) *UserState

func (*UserState) Create

func (d *UserState) Create(ctx context.Context, userState *entity.UserState, opt ...ExecOption) (*entity.UserState, error)

func (*UserState) Delete

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

func (*UserState) Select

func (d *UserState) Select(ctx context.Context, id int32) (*entity.UserState, error)

func (*UserState) SelectState

func (d *UserState) SelectState(ctx context.Context, state string) (*entity.UserState, error)

func (*UserState) Tx

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

func (*UserState) Update

func (d *UserState) Update(ctx context.Context, userState *entity.UserState, opt ...ExecOption) error

type UserStateInterface added in v0.11.0

type UserStateInterface interface {
	Tx(ctx context.Context, fn func(tx *sql.Tx) error) error
	Select(ctx context.Context, id int32) (*entity.UserState, error)
	SelectState(ctx context.Context, state string) (*entity.UserState, error)
	Create(ctx context.Context, userState *entity.UserState, opt ...ExecOption) (*entity.UserState, error)
	Update(ctx context.Context, userState *entity.UserState, opt ...ExecOption) error
	Delete(ctx context.Context, id int32, opt ...ExecOption) error
}

Jump to

Keyboard shortcuts

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