package operation

import "github.com/ydb-platform/ydb-go-sdk/v3/internal/operation"

Index

Constants

const (
	Finished  = Status(1 << iota >> 1)
	Undefined // may be true or may be false
	NotFinished
)

Binary flags that used as Status

Functions

func CancelAfter

func CancelAfter(ctx context.Context) (d time.Duration, ok bool)

CancelAfter returns the timeout within given context after which YDB should try to cancel operation and return result regardless of the cancellation.

func Params

func Params(
	ctx context.Context,
	timeout time.Duration,
	cancelAfter time.Duration,
	mode Mode,
) *Ydb_Operations.OperationParams

func Timeout

func Timeout(ctx context.Context) (d time.Duration, ok bool)

Timeout returns the timeout within given context after which YDB should try to cancel operation and return result regardless of the cancelation.

func WithCancelAfter

func WithCancelAfter(ctx context.Context, operationCancelAfter time.Duration) context.Context

WithCancelAfter returns a copy of parent context in which YDB operation cancel after parameter is set to d. If parent context cancellation timeout is smaller than d, parent context is returned.

func WithTimeout

func WithTimeout(ctx context.Context, operationTimeout time.Duration) context.Context

WithTimeout returns a copy of parent context in which YDB operation timeout parameter is set to d. If parent context timeout is smaller than d, parent context is returned.

Types

type Mode

type Mode uint
const (
	ModeUnknown Mode = iota
	ModeSync
	ModeAsync
)

func (Mode) String

func (m Mode) String() string

type Status

type Status uint8

Status reports which status of operation: completed or none

func (Status) String

func (t Status) String() string

Source Files

context.go mode.go params.go status.go timeout.go

Version
v3.26.0
Published
May 20, 2022
Platform
linux/amd64
Imports
5 packages
Last checked
6 minutes ago

Tools for package owners.