Documentation
¶
Overview ¶
Package client provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
Index ¶
- Constants
- Variables
- func NewDeleteTaskRequest(server string, id openapi_types.UUID) (*http.Request, error)
- func NewGetStatusRequest(server string) (*http.Request, error)
- func NewGetTaskRequest(server string, id openapi_types.UUID) (*http.Request, error)
- func NewHealthzRequest(server string) (*http.Request, error)
- func NewListTasksRequest(server string) (*http.Request, error)
- func NewSubmitTaskRequest(server string, body SubmitTaskJSONRequestBody) (*http.Request, error)
- func NewSubmitTaskRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- type AssembleAndUploadGenesisTask
- type AwaitConditionTask
- type Client
- func (c *Client) DeleteTask(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetTask(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) Healthz(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ListTasks(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) SubmitTask(ctx context.Context, body SubmitTaskJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) SubmitTaskWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) DeleteTaskWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteTaskResponse, error)
- func (c *ClientWithResponses) GetStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStatusResponse, error)
- func (c *ClientWithResponses) GetTaskWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetTaskResponse, error)
- func (c *ClientWithResponses) HealthzWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthzResponse, error)
- func (c *ClientWithResponses) ListTasksWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListTasksResponse, error)
- func (c *ClientWithResponses) SubmitTaskWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*SubmitTaskResponse, error)
- func (c *ClientWithResponses) SubmitTaskWithResponse(ctx context.Context, body SubmitTaskJSONRequestBody, ...) (*SubmitTaskResponse, error)
- type ClientWithResponsesInterface
- type ConfigApplyTask
- type ConfigPatchTask
- type ConfigReloadTask
- type ConfigValidateTask
- type ConfigureGenesisTask
- type ConfigureStateSyncTask
- type DeleteTaskResponse
- type DiscoverPeersTask
- type ErrorResponse
- type GenerateGentxTask
- type GenerateIdentityTask
- type GenesisNodeParam
- type GetStatusResponse
- type GetTaskResponse
- type HealthzResponse
- type HttpRequestDoer
- type ListTasksResponse
- type MarkReadyTask
- type Option
- type PeerSource
- type PeerSourceType
- type RequestEditorFn
- type ResultExportTask
- type SidecarClient
- func (c *SidecarClient) DeleteTask(ctx context.Context, id uuid.UUID) error
- func (c *SidecarClient) GetNodeID(ctx context.Context) (string, error)
- func (c *SidecarClient) GetTask(ctx context.Context, id uuid.UUID) (*TaskResult, error)
- func (c *SidecarClient) Healthz(ctx context.Context) (bool, error)
- func (c *SidecarClient) ListTasks(ctx context.Context) ([]TaskResult, error)
- func (c *SidecarClient) Status(ctx context.Context) (*StatusResponse, error)
- func (c *SidecarClient) SubmitAssembleAndUploadGenesisTask(ctx context.Context, task AssembleAndUploadGenesisTask) (uuid.UUID, error)
- func (c *SidecarClient) SubmitAwaitConditionTask(ctx context.Context, task AwaitConditionTask) (uuid.UUID, error)
- func (c *SidecarClient) SubmitConfigApplyTask(ctx context.Context, task ConfigApplyTask) (uuid.UUID, error)
- func (c *SidecarClient) SubmitConfigPatchTask(ctx context.Context, task ConfigPatchTask) (uuid.UUID, error)
- func (c *SidecarClient) SubmitConfigReloadTask(ctx context.Context, task ConfigReloadTask) (uuid.UUID, error)
- func (c *SidecarClient) SubmitConfigValidateTask(ctx context.Context, task ConfigValidateTask) (uuid.UUID, error)
- func (c *SidecarClient) SubmitConfigureGenesisTask(ctx context.Context, task ConfigureGenesisTask) (uuid.UUID, error)
- func (c *SidecarClient) SubmitConfigureStateSyncTask(ctx context.Context, task ConfigureStateSyncTask) (uuid.UUID, error)
- func (c *SidecarClient) SubmitDiscoverPeersTask(ctx context.Context, task DiscoverPeersTask) (uuid.UUID, error)
- func (c *SidecarClient) SubmitGenerateGentxTask(ctx context.Context, task GenerateGentxTask) (uuid.UUID, error)
- func (c *SidecarClient) SubmitGenerateIdentityTask(ctx context.Context, task GenerateIdentityTask) (uuid.UUID, error)
- func (c *SidecarClient) SubmitMarkReadyTask(ctx context.Context, task MarkReadyTask) (uuid.UUID, error)
- func (c *SidecarClient) SubmitResultExportTask(ctx context.Context, task ResultExportTask) (uuid.UUID, error)
- func (c *SidecarClient) SubmitSnapshotRestoreTask(ctx context.Context, task SnapshotRestoreTask) (uuid.UUID, error)
- func (c *SidecarClient) SubmitSnapshotUploadTask(ctx context.Context, task SnapshotUploadTask) (uuid.UUID, error)
- func (c *SidecarClient) SubmitTask(ctx context.Context, task TaskRequest) (uuid.UUID, error)
- func (c *SidecarClient) SubmitUploadGenesisArtifactsTask(ctx context.Context, task UploadGenesisArtifactsTask) (uuid.UUID, error)
- type SnapshotRestoreTask
- type SnapshotUploadTask
- type StatusResponse
- type StatusResponseStatus
- type SubmitTaskJSONRequestBody
- type SubmitTaskResponse
- type TaskBuilder
- type TaskMeta
- type TaskRequest
- type TaskResult
- type TaskResultStatus
- type TaskSubmitResponse
- type UploadGenesisArtifactsTask
Constants ¶
const ( TaskTypeSnapshotRestore = string(engine.TaskSnapshotRestore) TaskTypeDiscoverPeers = string(engine.TaskDiscoverPeers) TaskTypeConfigPatch = string(engine.TaskConfigPatch) TaskTypeConfigApply = string(engine.TaskConfigApply) TaskTypeConfigValidate = string(engine.TaskConfigValidate) TaskTypeConfigReload = string(engine.TaskConfigReload) TaskTypeMarkReady = string(engine.TaskMarkReady) TaskTypeConfigureGenesis = string(engine.TaskConfigureGenesis) TaskTypeConfigureStateSync = string(engine.TaskConfigureStateSync) TaskTypeSnapshotUpload = string(engine.TaskSnapshotUpload) TaskTypeResultExport = string(engine.TaskResultExport) TaskTypeAwaitCondition = string(engine.TaskAwaitCondition) TaskTypeGenerateIdentity = string(engine.TaskGenerateIdentity) TaskTypeGenerateGentx = string(engine.TaskGenerateGentx) TaskTypeUploadGenesisArtifacts = string(engine.TaskUploadGenesisArtifacts) TaskTypeAssembleGenesis = string(engine.TaskAssembleAndUploadGenesis) TaskTypeSetGenesisPeers = string(engine.TaskSetGenesisPeers) TaskTypeAssembleGenesisFork = string(engine.TaskAssembleGenesisFork) TaskTypeExportState = string(engine.TaskExportState) )
Task type constants re-exported from engine for external consumers.
const ( ConditionHeight = "height" ActionSIGTERM = "SIGTERM_SEID" )
Known condition and action values for AwaitConditionTask.
const DefaultPort int32 = 7777
Variables ¶
var ErrNotFound = errors.New("sidecar: task not found")
ErrNotFound is returned when the requested task does not exist (HTTP 404).
Functions ¶
func NewDeleteTaskRequest ¶
NewDeleteTaskRequest generates requests for DeleteTask
func NewGetStatusRequest ¶
NewGetStatusRequest generates requests for GetStatus
func NewGetTaskRequest ¶
NewGetTaskRequest generates requests for GetTask
func NewHealthzRequest ¶
NewHealthzRequest generates requests for Healthz
func NewListTasksRequest ¶
NewListTasksRequest generates requests for ListTasks
func NewSubmitTaskRequest ¶
func NewSubmitTaskRequest(server string, body SubmitTaskJSONRequestBody) (*http.Request, error)
NewSubmitTaskRequest calls the generic SubmitTask builder with application/json body
Types ¶
type AssembleAndUploadGenesisTask ¶ added in v0.0.21
type AssembleAndUploadGenesisTask struct {
TaskMeta
AccountBalance string
Namespace string
Nodes []GenesisNodeParam
}
AssembleAndUploadGenesisTask collects per-node artifacts and produces final genesis.json. S3 coordinates are derived by the sidecar from its environment.
func (AssembleAndUploadGenesisTask) TaskType ¶ added in v0.0.21
func (t AssembleAndUploadGenesisTask) TaskType() string
func (AssembleAndUploadGenesisTask) ToTaskRequest ¶ added in v0.0.21
func (t AssembleAndUploadGenesisTask) ToTaskRequest() TaskRequest
func (AssembleAndUploadGenesisTask) Validate ¶ added in v0.0.21
func (t AssembleAndUploadGenesisTask) Validate() error
type AwaitConditionTask ¶ added in v0.0.19
AwaitConditionTask blocks until a condition is met, then optionally executes a post-condition action. Currently supports the "height" condition and the "SIGTERM_SEID" action.
func (AwaitConditionTask) TaskType ¶ added in v0.0.19
func (t AwaitConditionTask) TaskType() string
func (AwaitConditionTask) ToTaskRequest ¶ added in v0.0.19
func (t AwaitConditionTask) ToTaskRequest() TaskRequest
func (AwaitConditionTask) Validate ¶ added in v0.0.19
func (t AwaitConditionTask) Validate() error
type Client ¶
type Client struct {
// The endpoint of the server conforming to this interface, with scheme,
// https://api.deepmap.com for example. This can contain a path relative
// to the server, such as https://api.deepmap.com/dev-test, and all the
// paths in the swagger spec will be appended to the server.
Server string
// Doer for performing requests, typically a *http.Client with any
// customized settings, such as certificate chains.
Client HttpRequestDoer
// A list of callbacks for modifying requests which are generated before sending over
// the network.
RequestEditors []RequestEditorFn
}
Client which conforms to the OpenAPI3 specification for this service.
func NewClient ¶
func NewClient(server string, opts ...ClientOption) (*Client, error)
Creates a new Client, with reasonable defaults
func (*Client) DeleteTask ¶
func (c *Client) DeleteTask(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) GetTask ¶
func (c *Client) GetTask(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) SubmitTask ¶
func (c *Client) SubmitTask(ctx context.Context, body SubmitTaskJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
type ClientInterface ¶
type ClientInterface interface {
// Healthz request
Healthz(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetStatus request
GetStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListTasks request
ListTasks(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// SubmitTaskWithBody request with any body
SubmitTaskWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
SubmitTask(ctx context.Context, body SubmitTaskJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// DeleteTask request
DeleteTask(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetTask request
GetTask(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
}
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
func WithHTTPClient ¶
func WithHTTPClient(doer HttpRequestDoer) ClientOption
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
func WithRequestEditorFn ¶
func WithRequestEditorFn(fn RequestEditorFn) ClientOption
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
type ClientWithResponses ¶
type ClientWithResponses struct {
ClientInterface
}
ClientWithResponses builds on ClientInterface to offer response payloads
func NewClientWithResponses ¶
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) DeleteTaskWithResponse ¶
func (c *ClientWithResponses) DeleteTaskWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteTaskResponse, error)
DeleteTaskWithResponse request returning *DeleteTaskResponse
func (*ClientWithResponses) GetStatusWithResponse ¶
func (c *ClientWithResponses) GetStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStatusResponse, error)
GetStatusWithResponse request returning *GetStatusResponse
func (*ClientWithResponses) GetTaskWithResponse ¶
func (c *ClientWithResponses) GetTaskWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetTaskResponse, error)
GetTaskWithResponse request returning *GetTaskResponse
func (*ClientWithResponses) HealthzWithResponse ¶
func (c *ClientWithResponses) HealthzWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthzResponse, error)
HealthzWithResponse request returning *HealthzResponse
func (*ClientWithResponses) ListTasksWithResponse ¶
func (c *ClientWithResponses) ListTasksWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListTasksResponse, error)
ListTasksWithResponse request returning *ListTasksResponse
func (*ClientWithResponses) SubmitTaskWithBodyWithResponse ¶
func (c *ClientWithResponses) SubmitTaskWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SubmitTaskResponse, error)
SubmitTaskWithBodyWithResponse request with arbitrary body returning *SubmitTaskResponse
func (*ClientWithResponses) SubmitTaskWithResponse ¶
func (c *ClientWithResponses) SubmitTaskWithResponse(ctx context.Context, body SubmitTaskJSONRequestBody, reqEditors ...RequestEditorFn) (*SubmitTaskResponse, error)
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// HealthzWithResponse request
HealthzWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthzResponse, error)
// GetStatusWithResponse request
GetStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStatusResponse, error)
// ListTasksWithResponse request
ListTasksWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListTasksResponse, error)
// SubmitTaskWithBodyWithResponse request with any body
SubmitTaskWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SubmitTaskResponse, error)
SubmitTaskWithResponse(ctx context.Context, body SubmitTaskJSONRequestBody, reqEditors ...RequestEditorFn) (*SubmitTaskResponse, error)
// DeleteTaskWithResponse request
DeleteTaskWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteTaskResponse, error)
// GetTaskWithResponse request
GetTaskWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetTaskResponse, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type ConfigApplyTask ¶ added in v0.0.9
type ConfigApplyTask struct {
TaskMeta
Intent seiconfig.ConfigIntent
}
ConfigApplyTask generates or patches node config using sei-config's intent resolution pipeline. The caller builds a ConfigIntent describing the desired state; the sidecar resolves it via sei-config.
func ConfigApplyTaskFromParams ¶ added in v0.0.9
func ConfigApplyTaskFromParams(params map[string]interface{}) ConfigApplyTask
ConfigApplyTaskFromParams reconstructs a ConfigApplyTask from a generic params map.
func (ConfigApplyTask) TaskType ¶ added in v0.0.9
func (t ConfigApplyTask) TaskType() string
func (ConfigApplyTask) ToTaskRequest ¶ added in v0.0.9
func (t ConfigApplyTask) ToTaskRequest() TaskRequest
func (ConfigApplyTask) Validate ¶ added in v0.0.9
func (t ConfigApplyTask) Validate() error
type ConfigPatchTask ¶
ConfigPatchTask applies generic TOML merge-patches to seid config files. Files maps a filename (e.g. "config.toml", "app.toml") to a nested patch that will be recursively merged into the existing file.
func (ConfigPatchTask) TaskType ¶
func (t ConfigPatchTask) TaskType() string
func (ConfigPatchTask) ToTaskRequest ¶
func (t ConfigPatchTask) ToTaskRequest() TaskRequest
func (ConfigPatchTask) Validate ¶
func (t ConfigPatchTask) Validate() error
type ConfigReloadTask ¶ added in v0.0.9
ConfigReloadTask patches hot-reloadable fields on disk and signals seid to re-read its configuration.
func ConfigReloadTaskFromParams ¶ added in v0.0.9
func ConfigReloadTaskFromParams(params map[string]interface{}) ConfigReloadTask
ConfigReloadTaskFromParams reconstructs a ConfigReloadTask from a generic params map.
func (ConfigReloadTask) TaskType ¶ added in v0.0.9
func (t ConfigReloadTask) TaskType() string
func (ConfigReloadTask) ToTaskRequest ¶ added in v0.0.9
func (t ConfigReloadTask) ToTaskRequest() TaskRequest
func (ConfigReloadTask) Validate ¶ added in v0.0.9
func (t ConfigReloadTask) Validate() error
type ConfigValidateTask ¶ added in v0.0.9
type ConfigValidateTask struct{ TaskMeta }
ConfigValidateTask reads on-disk config and returns validation diagnostics.
func (ConfigValidateTask) TaskType ¶ added in v0.0.9
func (t ConfigValidateTask) TaskType() string
func (ConfigValidateTask) ToTaskRequest ¶ added in v0.0.9
func (t ConfigValidateTask) ToTaskRequest() TaskRequest
func (ConfigValidateTask) Validate ¶ added in v0.0.9
func (t ConfigValidateTask) Validate() error
type ConfigureGenesisTask ¶
type ConfigureGenesisTask struct {
TaskMeta
}
ConfigureGenesisTask instructs the sidecar to resolve and write genesis.json. The sidecar resolves genesis from its chain ID: embedded config is checked first, then S3 fallback at {bucket}/{chainID}/genesis.json using env vars. No parameters are needed from the controller.
func ConfigureGenesisTaskFromParams ¶
func ConfigureGenesisTaskFromParams(_ map[string]interface{}) ConfigureGenesisTask
ConfigureGenesisTaskFromParams reconstructs a ConfigureGenesisTask from a generic params map.
func (ConfigureGenesisTask) TaskType ¶
func (t ConfigureGenesisTask) TaskType() string
func (ConfigureGenesisTask) ToTaskRequest ¶
func (t ConfigureGenesisTask) ToTaskRequest() TaskRequest
func (ConfigureGenesisTask) Validate ¶
func (t ConfigureGenesisTask) Validate() error
type ConfigureStateSyncTask ¶
type ConfigureStateSyncTask struct {
TaskMeta
UseLocalSnapshot bool
TrustPeriod string
BackfillBlocks int64
}
ConfigureStateSyncTask discovers a trust point and configures state sync. When UseLocalSnapshot is true, the task uses the locally-restored snapshot height as the trust height and sets use-local-snapshot = true in config.toml.
func (ConfigureStateSyncTask) TaskType ¶
func (t ConfigureStateSyncTask) TaskType() string
func (ConfigureStateSyncTask) ToTaskRequest ¶
func (t ConfigureStateSyncTask) ToTaskRequest() TaskRequest
func (ConfigureStateSyncTask) Validate ¶
func (t ConfigureStateSyncTask) Validate() error
type DeleteTaskResponse ¶
type DeleteTaskResponse struct {
Body []byte
HTTPResponse *http.Response
JSON404 *ErrorResponse
}
func ParseDeleteTaskResponse ¶
func ParseDeleteTaskResponse(rsp *http.Response) (*DeleteTaskResponse, error)
ParseDeleteTaskResponse parses an HTTP response from a DeleteTaskWithResponse call
func (DeleteTaskResponse) Status ¶
func (r DeleteTaskResponse) Status() string
Status returns HTTPResponse.Status
func (DeleteTaskResponse) StatusCode ¶
func (r DeleteTaskResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type DiscoverPeersTask ¶
type DiscoverPeersTask struct {
TaskMeta
Sources []PeerSource
}
DiscoverPeersTask resolves peers from one or more sources.
func DiscoverPeersTaskFromParams ¶
func DiscoverPeersTaskFromParams(params map[string]interface{}) (DiscoverPeersTask, error)
DiscoverPeersTaskFromParams reconstructs a DiscoverPeersTask from a generic params map.
func (DiscoverPeersTask) TaskType ¶
func (t DiscoverPeersTask) TaskType() string
func (DiscoverPeersTask) ToTaskRequest ¶
func (t DiscoverPeersTask) ToTaskRequest() TaskRequest
func (DiscoverPeersTask) Validate ¶
func (t DiscoverPeersTask) Validate() error
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
ErrorResponse defines model for ErrorResponse.
type GenerateGentxTask ¶ added in v0.0.21
type GenerateGentxTask struct {
TaskMeta
ChainID string
StakingAmount string
AccountBalance string
GenesisParams string
}
GenerateGentxTask creates a gentx for the validator. The handler discovers the node's own account address from the keys generated during identity creation and funds it with AccountBalance before generating the gentx.
func (GenerateGentxTask) TaskType ¶ added in v0.0.21
func (t GenerateGentxTask) TaskType() string
func (GenerateGentxTask) ToTaskRequest ¶ added in v0.0.21
func (t GenerateGentxTask) ToTaskRequest() TaskRequest
func (GenerateGentxTask) Validate ¶ added in v0.0.21
func (t GenerateGentxTask) Validate() error
type GenerateIdentityTask ¶ added in v0.0.21
GenerateIdentityTask creates validator identity (keys, node ID).
func (GenerateIdentityTask) TaskType ¶ added in v0.0.21
func (t GenerateIdentityTask) TaskType() string
func (GenerateIdentityTask) ToTaskRequest ¶ added in v0.0.21
func (t GenerateIdentityTask) ToTaskRequest() TaskRequest
func (GenerateIdentityTask) Validate ¶ added in v0.0.21
func (t GenerateIdentityTask) Validate() error
type GenesisNodeParam ¶ added in v0.0.21
type GenesisNodeParam struct {
Name string `json:"name"`
}
GenesisNodeParam is the wire format for nodes[] in assemble-and-upload-genesis.
type GetStatusResponse ¶
type GetStatusResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *StatusResponse
}
func ParseGetStatusResponse ¶
func ParseGetStatusResponse(rsp *http.Response) (*GetStatusResponse, error)
ParseGetStatusResponse parses an HTTP response from a GetStatusWithResponse call
func (GetStatusResponse) Status ¶
func (r GetStatusResponse) Status() string
Status returns HTTPResponse.Status
func (GetStatusResponse) StatusCode ¶
func (r GetStatusResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetTaskResponse ¶
type GetTaskResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *TaskResult
JSON404 *ErrorResponse
}
func ParseGetTaskResponse ¶
func ParseGetTaskResponse(rsp *http.Response) (*GetTaskResponse, error)
ParseGetTaskResponse parses an HTTP response from a GetTaskWithResponse call
func (GetTaskResponse) Status ¶
func (r GetTaskResponse) Status() string
Status returns HTTPResponse.Status
func (GetTaskResponse) StatusCode ¶
func (r GetTaskResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type HealthzResponse ¶
func ParseHealthzResponse ¶
func ParseHealthzResponse(rsp *http.Response) (*HealthzResponse, error)
ParseHealthzResponse parses an HTTP response from a HealthzWithResponse call
func (HealthzResponse) Status ¶
func (r HealthzResponse) Status() string
Status returns HTTPResponse.Status
func (HealthzResponse) StatusCode ¶
func (r HealthzResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type ListTasksResponse ¶
type ListTasksResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]TaskResult
}
func ParseListTasksResponse ¶
func ParseListTasksResponse(rsp *http.Response) (*ListTasksResponse, error)
ParseListTasksResponse parses an HTTP response from a ListTasksWithResponse call
func (ListTasksResponse) Status ¶
func (r ListTasksResponse) Status() string
Status returns HTTPResponse.Status
func (ListTasksResponse) StatusCode ¶
func (r ListTasksResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type MarkReadyTask ¶
type MarkReadyTask struct{ TaskMeta }
MarkReadyTask signals that bootstrap is complete.
func (MarkReadyTask) TaskType ¶
func (t MarkReadyTask) TaskType() string
func (MarkReadyTask) ToTaskRequest ¶
func (t MarkReadyTask) ToTaskRequest() TaskRequest
func (MarkReadyTask) Validate ¶
func (t MarkReadyTask) Validate() error
type Option ¶
type Option func(*sidecarOpts)
Option configures optional SidecarClient parameters.
func WithHTTPDoer ¶
func WithHTTPDoer(doer HttpRequestDoer) Option
WithHTTPDoer overrides the underlying HTTP transport.
func WithTimeout ¶
WithTimeout sets the HTTP client timeout. Defaults to 10s.
type PeerSource ¶
type PeerSource struct {
Type PeerSourceType
Region string
Tags map[string]string
Addresses []string
Endpoints []string
}
PeerSource is a single peer discovery source.
type PeerSourceType ¶
type PeerSourceType string
PeerSourceType identifies the peer discovery mechanism.
const ( PeerSourceEC2Tags PeerSourceType = "ec2Tags" PeerSourceStatic PeerSourceType = "static" PeerSourceDNSEndpoints PeerSourceType = "dnsEndpoints" )
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type ResultExportTask ¶ added in v0.0.16
type ResultExportTask struct {
TaskMeta
Bucket string
Prefix string
Region string
CanonicalRPC string
}
ResultExportTask queries the local seid RPC for block results and uploads them in paginated NDJSON files to S3. CanonicalRPC enables comparison mode: the sidecar compares local block results against the canonical chain and the task completes when app-hash divergence is detected.
func ResultExportTaskFromParams ¶ added in v0.0.16
func ResultExportTaskFromParams(params map[string]interface{}) ResultExportTask
ResultExportTaskFromParams reconstructs a ResultExportTask from a generic params map.
func (ResultExportTask) TaskType ¶ added in v0.0.16
func (t ResultExportTask) TaskType() string
func (ResultExportTask) ToTaskRequest ¶ added in v0.0.16
func (t ResultExportTask) ToTaskRequest() TaskRequest
func (ResultExportTask) Validate ¶ added in v0.0.16
func (t ResultExportTask) Validate() error
type SidecarClient ¶
type SidecarClient struct {
// contains filtered or unexported fields
}
SidecarClient wraps the generated ClientWithResponses with a simpler, error-oriented API.
func NewSidecarClient ¶
func NewSidecarClient(baseURL string, opts ...Option) (*SidecarClient, error)
NewSidecarClient creates a client from an explicit base URL.
func NewSidecarClientFromPodDNS ¶
func NewSidecarClientFromPodDNS(name, namespace string, port int32, opts ...Option) (*SidecarClient, error)
NewSidecarClientFromPodDNS builds a client targeting the sidecar via Kubernetes headless-service DNS:
http://{name}-0.{name}.{namespace}.svc.cluster.local:{port}
func (*SidecarClient) DeleteTask ¶
DeleteTask removes a task result or cancels a scheduled task.
func (*SidecarClient) GetNodeID ¶ added in v0.0.21
func (c *SidecarClient) GetNodeID(ctx context.Context) (string, error)
GetNodeID queries the sidecar's /v0/node-id endpoint and returns the Tendermint node ID (hex-encoded). This is a direct HTTP call rather than using the generated client, since /v0/node-id is outside the OpenAPI spec.
func (*SidecarClient) GetTask ¶
func (c *SidecarClient) GetTask(ctx context.Context, id uuid.UUID) (*TaskResult, error)
GetTask retrieves a single task result by ID.
func (*SidecarClient) Healthz ¶
func (c *SidecarClient) Healthz(ctx context.Context) (bool, error)
Healthz checks whether the sidecar is healthy. Returns (true, nil) for 200, (false, nil) for 503, and (false, error) for network failures or unexpected status codes.
func (*SidecarClient) ListTasks ¶
func (c *SidecarClient) ListTasks(ctx context.Context) ([]TaskResult, error)
ListTasks returns recent task results.
func (*SidecarClient) Status ¶
func (c *SidecarClient) Status(ctx context.Context) (*StatusResponse, error)
Status queries the sidecar's current lifecycle state.
func (*SidecarClient) SubmitAssembleAndUploadGenesisTask ¶ added in v0.0.22
func (c *SidecarClient) SubmitAssembleAndUploadGenesisTask(ctx context.Context, task AssembleAndUploadGenesisTask) (uuid.UUID, error)
func (*SidecarClient) SubmitAwaitConditionTask ¶ added in v0.0.20
func (c *SidecarClient) SubmitAwaitConditionTask(ctx context.Context, task AwaitConditionTask) (uuid.UUID, error)
func (*SidecarClient) SubmitConfigApplyTask ¶ added in v0.0.17
func (c *SidecarClient) SubmitConfigApplyTask(ctx context.Context, task ConfigApplyTask) (uuid.UUID, error)
func (*SidecarClient) SubmitConfigPatchTask ¶ added in v0.0.17
func (c *SidecarClient) SubmitConfigPatchTask(ctx context.Context, task ConfigPatchTask) (uuid.UUID, error)
func (*SidecarClient) SubmitConfigReloadTask ¶ added in v0.0.17
func (c *SidecarClient) SubmitConfigReloadTask(ctx context.Context, task ConfigReloadTask) (uuid.UUID, error)
func (*SidecarClient) SubmitConfigValidateTask ¶ added in v0.0.17
func (c *SidecarClient) SubmitConfigValidateTask(ctx context.Context, task ConfigValidateTask) (uuid.UUID, error)
func (*SidecarClient) SubmitConfigureGenesisTask ¶ added in v0.0.17
func (c *SidecarClient) SubmitConfigureGenesisTask(ctx context.Context, task ConfigureGenesisTask) (uuid.UUID, error)
func (*SidecarClient) SubmitConfigureStateSyncTask ¶ added in v0.0.17
func (c *SidecarClient) SubmitConfigureStateSyncTask(ctx context.Context, task ConfigureStateSyncTask) (uuid.UUID, error)
func (*SidecarClient) SubmitDiscoverPeersTask ¶ added in v0.0.17
func (c *SidecarClient) SubmitDiscoverPeersTask(ctx context.Context, task DiscoverPeersTask) (uuid.UUID, error)
func (*SidecarClient) SubmitGenerateGentxTask ¶ added in v0.0.22
func (c *SidecarClient) SubmitGenerateGentxTask(ctx context.Context, task GenerateGentxTask) (uuid.UUID, error)
func (*SidecarClient) SubmitGenerateIdentityTask ¶ added in v0.0.22
func (c *SidecarClient) SubmitGenerateIdentityTask(ctx context.Context, task GenerateIdentityTask) (uuid.UUID, error)
func (*SidecarClient) SubmitMarkReadyTask ¶ added in v0.0.17
func (c *SidecarClient) SubmitMarkReadyTask(ctx context.Context, task MarkReadyTask) (uuid.UUID, error)
func (*SidecarClient) SubmitResultExportTask ¶ added in v0.0.17
func (c *SidecarClient) SubmitResultExportTask(ctx context.Context, task ResultExportTask) (uuid.UUID, error)
func (*SidecarClient) SubmitSnapshotRestoreTask ¶ added in v0.0.17
func (c *SidecarClient) SubmitSnapshotRestoreTask(ctx context.Context, task SnapshotRestoreTask) (uuid.UUID, error)
func (*SidecarClient) SubmitSnapshotUploadTask ¶ added in v0.0.17
func (c *SidecarClient) SubmitSnapshotUploadTask(ctx context.Context, task SnapshotUploadTask) (uuid.UUID, error)
func (*SidecarClient) SubmitTask ¶
func (c *SidecarClient) SubmitTask(ctx context.Context, task TaskRequest) (uuid.UUID, error)
SubmitTask sends a TaskRequest to the sidecar. This is the generic submission path used internally by the typed Submit*Task methods and by the controller for dynamic dispatch. Prefer the typed methods for compile-time validation of task parameters.
func (*SidecarClient) SubmitUploadGenesisArtifactsTask ¶ added in v0.0.22
func (c *SidecarClient) SubmitUploadGenesisArtifactsTask(ctx context.Context, task UploadGenesisArtifactsTask) (uuid.UUID, error)
type SnapshotRestoreTask ¶
SnapshotRestoreTask downloads and extracts a snapshot archive from S3. S3 coordinates are derived by the sidecar from its environment. TargetHeight selects the highest available snapshot <= that height. When zero, the latest snapshot (from latest.txt) is used.
func SnapshotRestoreTaskFromParams ¶
func SnapshotRestoreTaskFromParams(params map[string]interface{}) SnapshotRestoreTask
SnapshotRestoreTaskFromParams reconstructs a SnapshotRestoreTask from a generic params map. Useful for round-trip testing.
func (SnapshotRestoreTask) TaskType ¶
func (t SnapshotRestoreTask) TaskType() string
func (SnapshotRestoreTask) ToTaskRequest ¶
func (t SnapshotRestoreTask) ToTaskRequest() TaskRequest
func (SnapshotRestoreTask) Validate ¶
func (t SnapshotRestoreTask) Validate() error
type SnapshotUploadTask ¶
type SnapshotUploadTask struct {
TaskMeta
}
SnapshotUploadTask archives and streams a local snapshot to S3. S3 coordinates are derived by the sidecar from its environment.
func SnapshotUploadTaskFromParams ¶
func SnapshotUploadTaskFromParams(_ map[string]interface{}) SnapshotUploadTask
SnapshotUploadTaskFromParams reconstructs a SnapshotUploadTask from a generic params map.
func (SnapshotUploadTask) TaskType ¶
func (t SnapshotUploadTask) TaskType() string
func (SnapshotUploadTask) ToTaskRequest ¶
func (t SnapshotUploadTask) ToTaskRequest() TaskRequest
func (SnapshotUploadTask) Validate ¶
func (t SnapshotUploadTask) Validate() error
type StatusResponse ¶
type StatusResponse struct {
Status StatusResponseStatus `json:"status"`
}
StatusResponse defines model for StatusResponse.
type StatusResponseStatus ¶
type StatusResponseStatus string
StatusResponseStatus defines model for StatusResponse.Status.
const ( Initializing StatusResponseStatus = "Initializing" Ready StatusResponseStatus = "Ready" )
Defines values for StatusResponseStatus.
type SubmitTaskJSONRequestBody ¶
type SubmitTaskJSONRequestBody = TaskRequest
SubmitTaskJSONRequestBody defines body for SubmitTask for application/json ContentType.
type SubmitTaskResponse ¶
type SubmitTaskResponse struct {
Body []byte
HTTPResponse *http.Response
JSON201 *TaskSubmitResponse
JSON202 *TaskSubmitResponse
JSON400 *ErrorResponse
}
func ParseSubmitTaskResponse ¶
func ParseSubmitTaskResponse(rsp *http.Response) (*SubmitTaskResponse, error)
ParseSubmitTaskResponse parses an HTTP response from a SubmitTaskWithResponse call
func (SubmitTaskResponse) Status ¶
func (r SubmitTaskResponse) Status() string
Status returns HTTPResponse.Status
func (SubmitTaskResponse) StatusCode ¶
func (r SubmitTaskResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type TaskBuilder ¶
type TaskBuilder interface {
TaskType() string
Validate() error
ToTaskRequest() TaskRequest
}
TaskBuilder is implemented by every typed task struct. It converts a strongly-typed task description into the generic TaskRequest wire format and validates required fields before submission.
type TaskMeta ¶ added in v0.0.22
TaskMeta carries optional metadata that applies to all task types. Embed this in any typed task struct. When ID is non-nil, the sidecar uses it as the canonical task identifier (enabling deterministic IDs from the controller). When nil, the engine generates a random UUID.
type TaskRequest ¶
type TaskRequest struct {
// Id Caller-provided task identifier. When set, the engine uses this as the canonical ID (enabling deterministic IDs from the controller). If a task with this ID already exists, the request is idempotent and returns the existing ID. When omitted, a random UUID is generated.
Id *openapi_types.UUID `json:"id,omitempty"`
Params *map[string]interface{} `json:"params,omitempty"`
// Type Task type identifier.
Type string `json:"type"`
}
TaskRequest defines model for TaskRequest.
type TaskResult ¶
type TaskResult struct {
CompletedAt *time.Time `json:"completedAt,omitempty"`
// Error Error message if the task failed.
Error *string `json:"error,omitempty"`
Id openapi_types.UUID `json:"id"`
Params *map[string]interface{} `json:"params,omitempty"`
// Status Current task lifecycle state.
Status TaskResultStatus `json:"status"`
SubmittedAt time.Time `json:"submittedAt"`
// Type Task type that was executed.
Type string `json:"type"`
}
TaskResult defines model for TaskResult.
type TaskResultStatus ¶ added in v0.0.15
type TaskResultStatus string
TaskResultStatus Current task lifecycle state.
const ( Completed TaskResultStatus = "completed" Failed TaskResultStatus = "failed" Running TaskResultStatus = "running" )
Defines values for TaskResultStatus.
type TaskSubmitResponse ¶
type TaskSubmitResponse struct {
// Id The assigned task UUID.
Id openapi_types.UUID `json:"id"`
}
TaskSubmitResponse defines model for TaskSubmitResponse.
type UploadGenesisArtifactsTask ¶ added in v0.0.21
UploadGenesisArtifactsTask uploads identity.json and gentx.json to S3. S3 coordinates are derived by the sidecar from its environment.
func (UploadGenesisArtifactsTask) TaskType ¶ added in v0.0.21
func (t UploadGenesisArtifactsTask) TaskType() string
func (UploadGenesisArtifactsTask) ToTaskRequest ¶ added in v0.0.21
func (t UploadGenesisArtifactsTask) ToTaskRequest() TaskRequest
func (UploadGenesisArtifactsTask) Validate ¶ added in v0.0.21
func (t UploadGenesisArtifactsTask) Validate() error