session

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExec       = errors.New("exec error")
	ErrTxRollback = errors.New("transaction rollback error")
	ErrTxCommit   = errors.New("transaction commit error")
	ErrShutdown   = errors.New("session is shut down")
)
View Source
var (
	ErrSessionCreate    = errors.New("session create failed")
	ErrSessionTransport = errors.New("session transport was not provided")
	ErrSessionAttach    = errors.New("session attach failed")
	ErrSessionDelete    = errors.New("session delete failed")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Transport      grpc.ClientConnInterface
	CreateResponse *Ydb_Query.CreateSessionResponse
	Logger         logger.Logger
}

type Session

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

func CreateSession

func CreateSession(
	ctx context.Context,
	qsc Ydb_Query_V1.QueryServiceClient,
	logger logger.Logger,
	timeout time.Duration,
) (*Session, error)

func (*Session) Alive

func (s *Session) Alive() bool

func (*Session) Close

func (s *Session) Close() error

func (*Session) CommitTX

func (s *Session) CommitTX(ctx context.Context, txID string) error

func (*Session) ID

func (s *Session) ID() uint64

func (*Session) RollbackTX

func (s *Session) RollbackTX(ctx context.Context, txID string) error

Jump to

Keyboard shortcuts

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