backend

package
v0.1.0-alpha1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	// Create will create resource and returns request.
	Create(ctx context.Context, rs *types.Resource) (*types.Request, error)

	// Delete will delete resource and returns request.
	Delete(ctx context.Context, id *types.Identifier) (*types.Request, error)

	// Update will update resource and returns request.
	Update(ctx context.Context, rs *types.ResourcePatch) (*types.Request, error)

	// Get gets the resource by ID.
	Get(ctx context.Context, id *types.Identifier) (*types.Resource, error)

	// List query resources.
	List(ctx context.Context, query *types.ResourceQuery) (*types.Result, error)

	// GetRequestStatus gets the request status by ID.
	GetRequestStatus(ctx context.Context, requestId string) (*types.Request, error)

	// CancelRequest cancels the request by ID.
	CancelRequest(ctx context.Context, requestId string) (*types.Request, error)

	// ListRequests lists requests.
	ListRequests(ctx context.Context, query *types.RequestQuery) (*types.RequestResult, error)
}

type RequestRepo

type RequestRepo interface {
	// Save saves the request.
	Save(ctx context.Context, req *types.Request) error

	// GetStatus gets the request status by ID.
	GetStatus(ctx context.Context, requestId string) (*types.Request, error)

	// Cancel cancels the request by ID.
	Cancel(ctx context.Context, requestId string) error

	// List lists requests.
	List(ctx context.Context, query *types.RequestQuery) (*types.RequestResult, error)
}

RequestRepo is the interface to manage the request state

type ResourceRepo

type ResourceRepo interface {
	// Save saves the resource.
	Save(ctx context.Context, resource *types.Resource) error

	// Get gets the resource by ID.
	Get(ctx context.Context, resourceId *types.Identifier) (*types.Resource, error)

	// Delete deletes the resource by ID.
	Delete(ctx context.Context, resourceId *types.Identifier) error

	// List lists resources.
	List(ctx context.Context, query *types.ResourceQuery) (*types.Result, error)
}

ResourceRepo is the interface to manage the resource state

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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