operation

package
v3.39.0-rc10 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Finished  = Status(iota)
	Undefined // may be true or may be false
	NotFinished
)

Binary flags that used as Status

Variables

This section is empty.

Functions

func CancelAfter added in v3.18.0

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 added in v3.18.0

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 added in v3.21.0

type Status uint8

Status reports which status of operation: completed or none

func (Status) String added in v3.21.0

func (t Status) String() string

Jump to

Keyboard shortcuts

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