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 CheckShardInstance ¶
func CheckShardInstance(ctx context.Context, instance activerecord.ShardInstance) (activerecord.OptionInterface, error)
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 Box(ctx context.Context, shard int, instType activerecord.ShardInstanceType, configPath string, optionCreator func(activerecord.ShardInstanceConfig) (activerecord.OptionInterface, error)) (*Connection, error)
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
Click to show internal directories.
Click to hide internal directories.