lrotesting

package
v0.85.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Test service for Long Running Operations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CancelOperationRequest

type CancelOperationRequest struct {
	// The name of the operation resource to be cancelled.
	Name string `json:"-" url:"-"`
}

type CreateTestResourceOperation

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

func (*CreateTestResourceOperation) Cancel

Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed.

func (*CreateTestResourceOperation) Done

func (a *CreateTestResourceOperation) Done() (bool, error)

Done reports whether the long-running operation has completed.

func (*CreateTestResourceOperation) Metadata

Metadata returns metadata associated with the long-running operation. If the metadata is not available, the returned metadata and error are both nil.

func (*CreateTestResourceOperation) Name

Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.

func (*CreateTestResourceOperation) Wait

Wait blocks until the long-running operation is completed with default 20 min timeout, the timeout can be overridden in the opts. If the operation didn't finished within the timeout, this function will through an error of type ErrTimedOut, otherwise successful response and any errors encountered.

type CreateTestResourceRequest

type CreateTestResourceRequest struct {
	// The resource to create
	Resource TestResource `json:"resource"`
}

type GetOperationRequest

type GetOperationRequest struct {
	// The name of the operation resource.
	Name string `json:"-" url:"-"`
}

type GetTestResourceRequest

type GetTestResourceRequest struct {
	// Resource ID to get
	ResourceId string `json:"-" url:"-"`
}

type LroTestingAPI

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

Test service for Long Running Operations

func NewLroTesting

func NewLroTesting(client *client.DatabricksClient) *LroTestingAPI

func (*LroTestingAPI) CancelOperation

func (a *LroTestingAPI) CancelOperation(ctx context.Context, request CancelOperationRequest) error

func (*LroTestingAPI) CreateTestResource

func (*LroTestingAPI) GetOperation

func (a *LroTestingAPI) GetOperation(ctx context.Context, request GetOperationRequest) (*common.Operation, error)

func (*LroTestingAPI) GetTestResource

func (a *LroTestingAPI) GetTestResource(ctx context.Context, request GetTestResourceRequest) (*TestResource, error)

type LroTestingInterface

type LroTestingInterface interface {
	CancelOperation(ctx context.Context, request CancelOperationRequest) error

	CreateTestResource(ctx context.Context, request CreateTestResourceRequest) (*CreateTestResourceOperation, error)

	GetOperation(ctx context.Context, request GetOperationRequest) (*common.Operation, error)

	// Simple method to get test resource
	GetTestResource(ctx context.Context, request GetTestResourceRequest) (*TestResource, error)
}

type TestResource

type TestResource struct {
	// Unique identifier for the resource
	Id string `json:"id,omitempty"`
	// Name of the resource
	Name string `json:"name,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

Test resource for LRO operations

func (TestResource) MarshalJSON

func (s TestResource) MarshalJSON() ([]byte, error)

func (*TestResource) UnmarshalJSON

func (s *TestResource) UnmarshalJSON(b []byte) error

type TestResourceOperationMetadata

type TestResourceOperationMetadata struct {
	// Progress percentage (0-100)
	ProgressPercent int `json:"progress_percent,omitempty"`
	// ID of the resource being operated on
	ResourceId string `json:"resource_id,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

Metadata for test resource operations

func (TestResourceOperationMetadata) MarshalJSON

func (s TestResourceOperationMetadata) MarshalJSON() ([]byte, error)

func (*TestResourceOperationMetadata) UnmarshalJSON

func (s *TestResourceOperationMetadata) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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