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: 8 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 UseEp

func UseEp(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 {
	CreateBatch(ctx context.Context, docs []entities.Application) ([]string, 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 {
	CreateBatch(ctx context.Context, docs []entities.Endpoint) ([]string, error)
	Count(ctx context.Context, wsId string, query *entities.PagingQuery) (int64, error)
	Get(ctx context.Context, wsId, id string) (*entities.Endpoint, error)
}

type EndpointRule

type EndpointRule interface {
	CreateBatch(ctx context.Context, docs []entities.EndpointRule) ([]string, error)
	Count(ctx context.Context, wsId string, query *entities.PagingQuery) (int64, error)
}

type SnaptshotRow

type SnaptshotRow struct {
	WsId                   string `json:"ws_id"`
	WsName                 string `json:"ws_name"`
	AppId                  string `json:"app_id"`
	AppName                string `json:"app_name"`
	EpId                   string `json:"ep_id"`
	EpName                 string `json:"ep_name"`
	EpMethod               string `json:"ep_method"`
	EpUri                  string `json:"ep_uri"`
	EprId                  string `json:"epr_id"`
	EprName                string `json:"epr_name"`
	EprPriority            int32  `json:"epr_priority"`
	EprExclusionary        bool   `json:"epr_exclusionary"`
	EprConditionSource     string `json:"epr_condition_source"`
	EprConditionExpression string `json:"epr_condition_expression"`
}

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) CreateBatch

func (sql *SqlApplication) CreateBatch(ctx context.Context, docs []entities.Application) ([]string, error)

func (*SqlApplication) Get

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

type SqlEndpoint

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

func (*SqlEndpoint) Count

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

func (*SqlEndpoint) CreateBatch

func (sql *SqlEndpoint) CreateBatch(ctx context.Context, docs []entities.Endpoint) ([]string, error)

func (*SqlEndpoint) Get

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

type SqlEndpointRule

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

func (*SqlEndpointRule) Count

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

func (*SqlEndpointRule) CreateBatch

func (sql *SqlEndpointRule) CreateBatch(ctx context.Context, docs []entities.EndpointRule) ([]string, error)

type SqlWorkspace

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

func (*SqlWorkspace) Create

func (*SqlWorkspace) Get

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

func (*SqlWorkspace) GetSnapshotRows

func (sql *SqlWorkspace) GetSnapshotRows(ct context.Context, id string) ([]SnaptshotRow, error)

func (*SqlWorkspace) ListByIds

func (sql *SqlWorkspace) ListByIds(ctx context.Context, ids []string) ([]entities.Workspace, error)

func (*SqlWorkspace) ListOwned

func (sql *SqlWorkspace) ListOwned(ctx context.Context, owner string) ([]entities.Workspace, error)

func (*SqlWorkspace) Update

type SqlWorkspaceCredentials

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

func (*SqlWorkspaceCredentials) Count

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

func (*SqlWorkspaceCredentials) Create

func (*SqlWorkspaceCredentials) Get

func (*SqlWorkspaceCredentials) List

func (*SqlWorkspaceCredentials) Update

type Workspace

type Workspace interface {
	Create(ctx context.Context, doc *entities.Workspace) (*entities.Workspace, error)
	Update(ctx context.Context, doc *entities.Workspace) (*entities.Workspace, error)
	ListByIds(ctx context.Context, ids []string) ([]entities.Workspace, error)
	Get(ctx context.Context, id string) (*entities.Workspace, error)
	ListOwned(ctx context.Context, owner string) ([]entities.Workspace, error)
	GetSnapshotRows(ct context.Context, id string) ([]SnaptshotRow, error)
}

Jump to

Keyboard shortcuts

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