operation

package
v0.0.0-...-417428f Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPollInterval = time.Second

Variables

This section is empty.

Functions

func UnmarshalAny

func UnmarshalAny(msg *any.Any) (proto.Message, error)

Copy from bb.yandex-team.ru/cloud/cloud-go/pkg/protoutil/any.go

Types

type Operation

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

func New

func New(client Client, proto *Proto) *Operation

func (*Operation) Cancel

func (o *Operation) Cancel(ctx context.Context, opts ...grpc.CallOption) error

Cancel requests operation cancel. On success operation state is updated. Returns error if cancel failed.

func (*Operation) Client

func (o *Operation) Client() Client

func (*Operation) CreatedAt

func (o *Operation) CreatedAt() time.Time

func (*Operation) CreatedBy

func (o *Operation) CreatedBy() string

func (*Operation) Description

func (o *Operation) Description() string

func (*Operation) Done

func (o *Operation) Done() bool

func (*Operation) Error

func (o *Operation) Error() error

func (*Operation) ErrorStatus

func (o *Operation) ErrorStatus() *status.Status

func (*Operation) Failed

func (o *Operation) Failed() bool

func (*Operation) Id

func (o *Operation) Id() string

func (*Operation) Metadata

func (o *Operation) Metadata() (proto.Message, error)

func (*Operation) Ok

func (o *Operation) Ok() bool

func (*Operation) Poll

func (o *Operation) Poll(ctx context.Context, opts ...grpc.CallOption) error

Poll gets new state of operation from operation client. On success the operation state is updated. Returns error if update request failed.

func (*Operation) Proto

func (o *Operation) Proto() *Proto

func (*Operation) RawMetadata

func (o *Operation) RawMetadata() *any.Any

func (*Operation) RawResponse

func (o *Operation) RawResponse() *any.Any

func (*Operation) Response

func (o *Operation) Response() (proto.Message, error)

func (*Operation) Wait

func (o *Operation) Wait(ctx context.Context, opts ...grpc.CallOption) error

func (*Operation) WaitInterval

func (o *Operation) WaitInterval(ctx context.Context, pollInterval time.Duration, opts ...grpc.CallOption) error

type Proto

type Proto = operation.Operation

Jump to

Keyboard shortcuts

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