Documentation
¶
Index ¶
- type CancelOperationRequest
- type GetOperationRequest
- type ListOperationsRequest
- type ListOperationsResponse
- type Operation
- type Result
- type Service
- func (s Service) CancelOperation(ctx context.Context, request CancelOperationRequest) (*Operation, error)
- func (s Service) GetOperation(ctx context.Context, request GetOperationRequest) (*Operation, error)
- func (s Service) ListOperations(ctx context.Context, request ListOperationsRequest) (*ListOperationsResponse, error)
- func (s Service) Status() framework.Status
- func (s Service) Type() framework.Type
- type ServiceModelFunc
- type Storage
- func (s Storage) CancelOperation(ctx context.Context, id string) (*opstorage.StoredOperation, error)
- func (s Storage) DeleteOperation(ctx context.Context, id string) error
- func (s Storage) GetOperation(ctx context.Context, id string) (opstorage.StoredOperation, error)
- func (s Storage) ListOperations(ctx context.Context, parent string, filter filtering.Filter) ([]opstorage.StoredOperation, error)
- func (s Storage) StoreOperation(ctx context.Context, op opstorage.StoredOperation) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CancelOperationRequest ¶
type CancelOperationRequest struct {
ID string `json:"id" validate:"required"`
}
func (CancelOperationRequest) Validate ¶
func (r CancelOperationRequest) Validate() error
Validate does struct validation and returns an error when invalid.
type GetOperationRequest ¶
type GetOperationRequest struct {
ID string `json:"id" validate:"required"`
}
func (GetOperationRequest) Validate ¶
func (r GetOperationRequest) Validate() error
Validate does struct validation and returns an error when invalid.
type ListOperationsRequest ¶
func (ListOperationsRequest) Validate ¶
func (r ListOperationsRequest) Validate() error
type ListOperationsResponse ¶
type ListOperationsResponse struct {
Operations []Operation
}
type Operation ¶
type Operation struct { ID string `json:"json"` Done bool `json:"done"` Result Result `json:"result,omitempty"` }
func ServiceModel ¶
func ServiceModel(op opstorage.StoredOperation) (*Operation, error)
ServiceModel converts a storage.StoredOperation to an Operation. The Result.Response field is introspected and converted into the service layer's model.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewOperationService ¶
func NewOperationService(s storage.ServiceStorage) (*Service, error)
func (Service) CancelOperation ¶
func (Service) GetOperation ¶
func (Service) ListOperations ¶
func (s Service) ListOperations(ctx context.Context, request ListOperationsRequest) (*ListOperationsResponse, error)
type ServiceModelFunc ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func NewOperationStorage ¶
func NewOperationStorage(db storage.ServiceStorage) (*Storage, error)
func (Storage) CancelOperation ¶
func (Storage) DeleteOperation ¶
func (Storage) GetOperation ¶
func (Storage) ListOperations ¶
func (Storage) StoreOperation ¶
Click to show internal directories.
Click to hide internal directories.