db

package
v0.0.0-...-d386c04 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UseApp

func UseApp(target string) func(db *gorm.DB) *gorm.DB

func UseAppId

func UseAppId(appId, target string) func(db *gorm.DB) *gorm.DB

func UseEp

func UseEp(target string) func(db *gorm.DB) *gorm.DB

func UseEpId

func UseEpId(epId, target string) func(db *gorm.DB) *gorm.DB

func UseWsId

func UseWsId(wsId, target string) func(db *gorm.DB) *gorm.DB

Types

type Application

type Application interface {
	Create(ctx context.Context, doc *entities.Application) (*entities.Application, error)
	Update(ctx context.Context, doc *entities.Application) (*entities.Application, error)
	Delete(ctx context.Context, doc *entities.Application) error

	List(ctx context.Context, wsId string, query *entities.PagingQuery) ([]entities.Application, error)
	Count(ctx context.Context, wsId string, query *entities.PagingQuery) (int64, error)
	Get(ctx context.Context, wsId, id string) (*entities.Application, error)
}

type Database

type Database interface {
	Transaction(ctx context.Context, handler func(txctx context.Context) (interface{}, error)) (res interface{}, err error)
	Workspace() Workspace
	WorkspaceCredentials() WorkspaceCredentials
	Application() Application
	Endpoint() Endpoint
	EndpointRule() EndpointRule
}

func New

func New(logger logging.Logger, db database.Database) Database

func NewSql

func NewSql(logger logging.Logger, db database.Database) Database

type Endpoint

type Endpoint interface {
	Create(ctx context.Context, doc *entities.Endpoint) (*entities.Endpoint, error)
	Update(ctx context.Context, doc *entities.Endpoint) (*entities.Endpoint, error)
	Delete(ctx context.Context, doc *entities.Endpoint) error

	List(ctx context.Context, wsId, appId string, query *entities.PagingQuery) ([]entities.Endpoint, error)
	Count(ctx context.Context, wsId, appId string, query *entities.PagingQuery) (int64, error)
	Get(ctx context.Context, wsId string, id string) (*entities.Endpoint, error)
}

type EndpointRule

type EndpointRule interface {
	Create(ctx context.Context, doc *entities.EndpointRule) (*entities.EndpointRule, error)
	Update(ctx context.Context, doc *entities.EndpointRule) (*entities.EndpointRule, error)
	Delete(ctx context.Context, doc *entities.EndpointRule) error

	List(ctx context.Context, wsId, appId, epId string, query *entities.PagingQuery) ([]entities.EndpointRule, error)
	Count(ctx context.Context, wsId, appId, epId string, query *entities.PagingQuery) (int64, error)
	Get(ctx context.Context, wsId string, id string) (*entities.EndpointRule, error)
}

type SqlApplication

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

func (*SqlApplication) Count

func (sql *SqlApplication) Count(ctx context.Context, wsId string, query *entities.PagingQuery) (int64, error)

func (*SqlApplication) Create

func (*SqlApplication) Delete

func (sql *SqlApplication) Delete(ctx context.Context, doc *entities.Application) error

func (*SqlApplication) Get

func (sql *SqlApplication) Get(ctx context.Context, wsId, id string) (*entities.Application, error)

func (*SqlApplication) List

func (*SqlApplication) Update

type SqlEndpoint

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

func (*SqlEndpoint) Count

func (sql *SqlEndpoint) Count(ctx context.Context, wsId, appId string, query *entities.PagingQuery) (int64, error)

func (*SqlEndpoint) Create

func (sql *SqlEndpoint) Create(ctx context.Context, doc *entities.Endpoint) (*entities.Endpoint, error)

func (*SqlEndpoint) Delete

func (sql *SqlEndpoint) Delete(ctx context.Context, doc *entities.Endpoint) error

func (*SqlEndpoint) Get

func (sql *SqlEndpoint) Get(ctx context.Context, wsId string, id string) (*entities.Endpoint, error)

func (*SqlEndpoint) List

func (sql *SqlEndpoint) List(ctx context.Context, wsId, appId string, query *entities.PagingQuery) ([]entities.Endpoint, error)

func (*SqlEndpoint) Update

func (sql *SqlEndpoint) Update(ctx context.Context, doc *entities.Endpoint) (*entities.Endpoint, error)

type SqlEndpointRule

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

func (*SqlEndpointRule) Count

func (sql *SqlEndpointRule) Count(ctx context.Context, wsId, appId, epId string, query *entities.PagingQuery) (int64, error)

func (*SqlEndpointRule) Create

func (*SqlEndpointRule) Delete

func (sql *SqlEndpointRule) Delete(ctx context.Context, doc *entities.EndpointRule) error

func (*SqlEndpointRule) Get

func (sql *SqlEndpointRule) Get(ctx context.Context, wsId string, id string) (*entities.EndpointRule, error)

func (*SqlEndpointRule) List

func (sql *SqlEndpointRule) List(ctx context.Context, wsId, appId, epId string, query *entities.PagingQuery) ([]entities.EndpointRule, error)

func (*SqlEndpointRule) Update

type SqlWorkspace

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

func (*SqlWorkspace) Get

func (sql *SqlWorkspace) Get(ctx context.Context, id string) (*entities.Workspace, error)

type SqlWorkspaceCredentials

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

func (*SqlWorkspaceCredentials) Get

type Workspace

type Workspace interface {
	Get(ctx context.Context, id string) (*entities.Workspace, error)
}

type WorkspaceCredentials

type WorkspaceCredentials interface {
	Get(ctx context.Context, id string) (*entities.WorkspaceCredentials, error)
}

Jump to

Keyboard shortcuts

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