data_service

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DestroyDataService

func DestroyDataService(ds *DataService) error

Types

type Config

type Config struct {
	Token      string `json:"token" yaml:"token"`
	Address    string `json:"address" yaml:"address"`
	HttpPort   string `json:"http_port" yaml:"http_port"`
	GrpcPort   string `json:"grpc_port" yaml:"grpc_port"`
	Namespace  string `json:"namespace" yaml:"namespace"`
	DataSource string `json:"data_source" yaml:"data_source"`
	TimeoutSec int64  `json:"timeout_sec" yaml:"timeout_sec"`
}

type DataService

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

func NewDataService

func NewDataService(config *Config) (*DataService, error)

func (*DataService) ExecuteRawSql

func (ds *DataService) ExecuteRawSql(sqlStr string, executeParams map[string]any) ([]sql.Result, error)

func (*DataService) ExecuteSql

func (ds *DataService) ExecuteSql(name string, executeParams map[string]any) ([]sql.Result, error)

func (*DataService) Transaction

func (ds *DataService) Transaction(txFunc TxFunc) error

type Transaction

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

func (*Transaction) ExecuteRawSql

func (tx *Transaction) ExecuteRawSql(sqlStr string, executeParams map[string]any) ([]sql.Result, error)

func (*Transaction) ExecuteSql

func (tx *Transaction) ExecuteSql(name string, executeParams map[string]any) ([]sql.Result, error)

type TxFunc

type TxFunc func(tx *Transaction) error

Directories

Path Synopsis
v1

Jump to

Keyboard shortcuts

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