tarantool

package
v1.12.2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultConnectionTimeout = 20 * time.Millisecond

Variables

View Source
var DefaultConnectionParams = activerecord.MapGlobParam{
	Timeout: DefaultConnectionTimeout,
}
View Source
var DefaultOptionCreator = func(sic activerecord.ShardInstanceConfig) (activerecord.OptionInterface, error) {
	return NewOptions(sic.Addr, sic.Mode, WithTimeout(sic.Timeout), WithCredential(sic.User, sic.Password))
}

Functions

func BuildSQLPredicateIN

func BuildSQLPredicateIN(fieldname string, fieldCndt int) string

Types

type BaseField

type BaseField struct {
	Collection []ModelStruct
	UpdateOps  []tarantool.Op
	Exists     bool
	IsReplica  bool
	ReadOnly   bool
	Objects    map[string][]ModelStruct
}

type Connection

type Connection struct {
	*tarantool.Connection
	// contains filtered or unexported fields
}

func Box

func GetConnection

func GetConnection(_ context.Context, opts *ConnectionOptions) (*Connection, error)

func (*Connection) Close

func (c *Connection) Close()

func (*Connection) Done

func (c *Connection) Done() <-chan struct{}

func (*Connection) Info

func (c *Connection) Info() string

func (*Connection) InstanceMode

func (c *Connection) InstanceMode() any

type ConnectionOption

type ConnectionOption interface {
	// contains filtered or unexported methods
}

func WithCredential

func WithCredential(user, pass string) ConnectionOption

WithCredential - опция авторизации

func WithTimeout

func WithTimeout(request time.Duration) ConnectionOption

WithTimeout - опция для изменений таймаутов

type ConnectionOptions

type ConnectionOptions struct {
	*activerecord.GroupHash

	Mode activerecord.ServerModeType
	// contains filtered or unexported fields
}

func NewOptions

func NewOptions(server string, mode activerecord.ServerModeType, opts ...ConnectionOption) (*ConnectionOptions, error)

func (*ConnectionOptions) GetConnectionID

func (c *ConnectionOptions) GetConnectionID() string

func (*ConnectionOptions) InstanceMode

func (c *ConnectionOptions) InstanceMode() activerecord.ServerModeType

type ModelStruct

type ModelStruct interface {
	Insert(ctx context.Context) error
	Replace(ctx context.Context) error
	InsertOrReplace(ctx context.Context) error
	Update(ctx context.Context) error
	Delete(ctx context.Context) error
}

Jump to

Keyboard shortcuts

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