adminapi

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithServerURL

func WithServerURL(ctx context.Context, u *url.URL) context.Context

WithServerURL sets context key to override server URL.

Types

type AccessKey

type AccessKey struct {
	AccessKey string  `json:"access_key"`
	Grants    []Grant `json:"grants"`
	Source    Source  `json:"source"`
	// Creation time, for runtime-managed credentials.
	CreatedAt OptDateTime `json:"created_at"`
}

Ref: #/components/schemas/AccessKey

func (*AccessKey) Decode

func (s *AccessKey) Decode(d *jx.Decoder) error

Decode decodes AccessKey from json.

func (*AccessKey) Encode

func (s *AccessKey) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*AccessKey) GetAccessKey

func (s *AccessKey) GetAccessKey() string

GetAccessKey returns the value of AccessKey.

func (*AccessKey) GetCreatedAt

func (s *AccessKey) GetCreatedAt() OptDateTime

GetCreatedAt returns the value of CreatedAt.

func (*AccessKey) GetGrants

func (s *AccessKey) GetGrants() []Grant

GetGrants returns the value of Grants.

func (*AccessKey) GetSource

func (s *AccessKey) GetSource() Source

GetSource returns the value of Source.

func (*AccessKey) MarshalJSON

func (s *AccessKey) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AccessKey) SetAccessKey

func (s *AccessKey) SetAccessKey(val string)

SetAccessKey sets the value of AccessKey.

func (*AccessKey) SetCreatedAt

func (s *AccessKey) SetCreatedAt(val OptDateTime)

SetCreatedAt sets the value of CreatedAt.

func (*AccessKey) SetGrants

func (s *AccessKey) SetGrants(val []Grant)

SetGrants sets the value of Grants.

func (*AccessKey) SetSource

func (s *AccessKey) SetSource(val Source)

SetSource sets the value of Source.

func (*AccessKey) UnmarshalJSON

func (s *AccessKey) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*AccessKey) Validate

func (s *AccessKey) Validate() error

type AccessKeyList

type AccessKeyList struct {
	Keys []AccessKey `json:"keys"`
}

Ref: #/components/schemas/AccessKeyList

func (*AccessKeyList) Decode

func (s *AccessKeyList) Decode(d *jx.Decoder) error

Decode decodes AccessKeyList from json.

func (*AccessKeyList) Encode

func (s *AccessKeyList) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*AccessKeyList) GetKeys

func (s *AccessKeyList) GetKeys() []AccessKey

GetKeys returns the value of Keys.

func (*AccessKeyList) MarshalJSON

func (s *AccessKeyList) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AccessKeyList) SetKeys

func (s *AccessKeyList) SetKeys(val []AccessKey)

SetKeys sets the value of Keys.

func (*AccessKeyList) UnmarshalJSON

func (s *AccessKeyList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*AccessKeyList) Validate

func (s *AccessKeyList) Validate() error

type BucketScheme added in v0.7.0

type BucketScheme struct {
	Bucket string `json:"bucket"`
	// The effective scheme: the override when set, otherwise the cluster default.
	Scheme string `json:"scheme"`
	// The explicit override; empty when the bucket follows the cluster default.
	Override OptString `json:"override"`
	// The cluster default scheme, applied to buckets without an override.
	ClusterDefault string `json:"cluster_default"`
	// True when the bucket has no override and follows the cluster default.
	IsDefault bool `json:"is_default"`
}

A bucket's effective replication scheme and whether it overrides the cluster default. Ref: #/components/schemas/BucketScheme

func (*BucketScheme) Decode added in v0.7.0

func (s *BucketScheme) Decode(d *jx.Decoder) error

Decode decodes BucketScheme from json.

func (*BucketScheme) Encode added in v0.7.0

func (s *BucketScheme) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*BucketScheme) GetBucket added in v0.7.0

func (s *BucketScheme) GetBucket() string

GetBucket returns the value of Bucket.

func (*BucketScheme) GetClusterDefault added in v0.7.0

func (s *BucketScheme) GetClusterDefault() string

GetClusterDefault returns the value of ClusterDefault.

func (*BucketScheme) GetIsDefault added in v0.7.0

func (s *BucketScheme) GetIsDefault() bool

GetIsDefault returns the value of IsDefault.

func (*BucketScheme) GetOverride added in v0.7.0

func (s *BucketScheme) GetOverride() OptString

GetOverride returns the value of Override.

func (*BucketScheme) GetScheme added in v0.7.0

func (s *BucketScheme) GetScheme() string

GetScheme returns the value of Scheme.

func (*BucketScheme) MarshalJSON added in v0.7.0

func (s *BucketScheme) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*BucketScheme) SetBucket added in v0.7.0

func (s *BucketScheme) SetBucket(val string)

SetBucket sets the value of Bucket.

func (*BucketScheme) SetClusterDefault added in v0.7.0

func (s *BucketScheme) SetClusterDefault(val string)

SetClusterDefault sets the value of ClusterDefault.

func (*BucketScheme) SetIsDefault added in v0.7.0

func (s *BucketScheme) SetIsDefault(val bool)

SetIsDefault sets the value of IsDefault.

func (*BucketScheme) SetOverride added in v0.7.0

func (s *BucketScheme) SetOverride(val OptString)

SetOverride sets the value of Override.

func (*BucketScheme) SetScheme added in v0.7.0

func (s *BucketScheme) SetScheme(val string)

SetScheme sets the value of Scheme.

func (*BucketScheme) UnmarshalJSON added in v0.7.0

func (s *BucketScheme) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Client

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

Client implements OAS client.

func NewClient

func NewClient(serverURL string, opts ...ClientOption) (*Client, error)

NewClient initializes new Client defined by OAS.

func (*Client) ControlRebalance

func (c *Client) ControlRebalance(ctx context.Context, request *RebalanceControlRequest) (*RebalanceStatus, error)

ControlRebalance invokes controlRebalance operation.

Start, pause or resume the cluster-wide rebalance from this node. At most one rebalance runs cluster-wide (etcd election); starting on several nodes leaves the extras waiting as standby runners. Pausing stops this node's runner and keeps the resume cursor, so a later start/resume — on any node — continues where it left off.

POST /api/v1/cluster/rebalance

func (*Client) CreateAccessKey

func (c *Client) CreateAccessKey(ctx context.Context, request *CreateAccessKeyRequest) (*CreatedAccessKey, error)

CreateAccessKey invokes createAccessKey operation.

Create a runtime credential. The access key and secret are generated when not supplied. The secret is returned only in this response and cannot be retrieved later.

POST /api/v1/access-keys

func (*Client) DeleteAccessKey

func (c *Client) DeleteAccessKey(ctx context.Context, params DeleteAccessKeyParams) error

DeleteAccessKey invokes deleteAccessKey operation.

Remove a runtime credential. Config-defined credentials cannot be deleted.

DELETE /api/v1/access-keys/{accessKey}

func (*Client) GetBucketScheme added in v0.7.0

func (c *Client) GetBucketScheme(ctx context.Context, params GetBucketSchemeParams) (*BucketScheme, error)

GetBucketScheme invokes getBucketScheme operation.

The bucket's effective replication scheme, its explicit override (empty when the bucket follows the cluster default) and the cluster default. Returns 404 when the bucket does not exist and 501 when the server is not in cluster mode (a single-node server has no per-bucket schemes).

GET /api/v1/buckets/{bucket}/scheme

func (*Client) GetClusterStatus

func (c *Client) GetClusterStatus(ctx context.Context) (*ClusterStatus, error)

GetClusterStatus invokes getClusterStatus operation.

Cluster-wide view read from the control plane: the agreed schema version, every node with its disks and reported capacity, aggregate capacity, placement skew and whether a rebalance is currently running. State is "disabled" when the server is not in cluster mode.

GET /api/v1/cluster/status

func (*Client) GetInfo

func (c *Client) GetInfo(ctx context.Context) (*InstanceInfo, error)

GetInfo invokes getInfo operation.

Build information, uptime and whether authentication is enabled.

GET /api/v1/info

func (*Client) GetPublicReadBuckets added in v0.8.0

func (c *Client) GetPublicReadBuckets(ctx context.Context) (*PublicReadBuckets, error)

GetPublicReadBuckets invokes getPublicReadBuckets operation.

Buckets readable anonymously (unsigned GET/HEAD/list), cluster-wide. Available only with cluster-wide credentials (auth.source: etcd); returns 501 otherwise, where public-read buckets are managed in the config file per node.

GET /api/v1/public-read-buckets

func (*Client) GetRebalanceStatus

func (c *Client) GetRebalanceStatus(ctx context.Context) (*RebalanceStatus, error)

GetRebalanceStatus invokes getRebalanceStatus operation.

State and progress of the cluster rebalance runner on this node, the persisted resume cursor and the depth of the async repair queue. State is "disabled" when the server is not in cluster mode.

GET /api/v1/cluster/rebalance

func (*Client) ListAccessKeys

func (c *Client) ListAccessKeys(ctx context.Context) (*AccessKeyList, error)

ListAccessKeys invokes listAccessKeys operation.

Every credential the server accepts, secrets omitted.

GET /api/v1/access-keys

func (*Client) ReloadConfig

func (c *Client) ReloadConfig(ctx context.Context) (*ReloadResult, error)

ReloadConfig invokes reloadConfig operation.

Re-read the configuration file and apply the parts that change without a restart — the config-defined credentials and grants, the anonymously readable buckets and the TLS certificate — exactly as SIGHUP does. Runtime credentials created through this API are preserved. Returns what was reloaded and the config revision now in effect, so an orchestrator can confirm a config change landed without shelling into the process. Returns 501 on a listener with nothing to reload (the headless cluster admin serves no S3 data).

POST /api/v1/reload

func (*Client) SetBucketScheme added in v0.7.0

func (c *Client) SetBucketScheme(ctx context.Context, request *SetBucketSchemeRequest, params SetBucketSchemeParams) (*BucketScheme, error)

SetBucketScheme invokes setBucketScheme operation.

Override the bucket's replication scheme, or clear the override to restore the cluster default. The scheme must parse ("rf2.5", "rf3" or "ec:k,m") and the current topology must be able to host it. The change affects new writes cluster-wide within seconds; existing objects convert through repair/rebalance. Returns the effective scheme after applying. Returns 400 when the scheme is invalid or the topology cannot host it, 404 when the bucket does not exist and 501 when the server is not in cluster mode.

PUT /api/v1/buckets/{bucket}/scheme

func (*Client) SetPublicReadBuckets added in v0.8.0

func (c *Client) SetPublicReadBuckets(ctx context.Context, request *SetPublicReadBucketsRequest) (*PublicReadBuckets, error)

SetPublicReadBuckets invokes setPublicReadBuckets operation.

Replace the cluster-wide public-read bucket list. The change propagates to every node within seconds with no restart. Returns the stored list. Returns 400 on an invalid bucket name and 501 when not using cluster-wide credentials.

PUT /api/v1/public-read-buckets

type ClientOption

type ClientOption interface {
	// contains filtered or unexported methods
}

ClientOption is client config option.

func WithClient

func WithClient(client ht.Client) ClientOption

WithClient specifies http client to use.

type ClusterDisk

type ClusterDisk struct {
	ID string `json:"id"`
	// Relative placement weight (0 = drained).
	Weight float64 `json:"weight"`
	// Reported filesystem size; 0 when the node has not reported capacity.
	TotalBytes OptInt64 `json:"total_bytes"`
	FreeBytes  OptInt64 `json:"free_bytes"`
	// Used fraction (0..1); omitted when capacity is unknown.
	Fullness OptFloat64 `json:"fullness"`
}

Ref: #/components/schemas/ClusterDisk

func (*ClusterDisk) Decode

func (s *ClusterDisk) Decode(d *jx.Decoder) error

Decode decodes ClusterDisk from json.

func (*ClusterDisk) Encode

func (s *ClusterDisk) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*ClusterDisk) GetFreeBytes

func (s *ClusterDisk) GetFreeBytes() OptInt64

GetFreeBytes returns the value of FreeBytes.

func (*ClusterDisk) GetFullness

func (s *ClusterDisk) GetFullness() OptFloat64

GetFullness returns the value of Fullness.

func (*ClusterDisk) GetID

func (s *ClusterDisk) GetID() string

GetID returns the value of ID.

func (*ClusterDisk) GetTotalBytes

func (s *ClusterDisk) GetTotalBytes() OptInt64

GetTotalBytes returns the value of TotalBytes.

func (*ClusterDisk) GetWeight

func (s *ClusterDisk) GetWeight() float64

GetWeight returns the value of Weight.

func (*ClusterDisk) MarshalJSON

func (s *ClusterDisk) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ClusterDisk) SetFreeBytes

func (s *ClusterDisk) SetFreeBytes(val OptInt64)

SetFreeBytes sets the value of FreeBytes.

func (*ClusterDisk) SetFullness

func (s *ClusterDisk) SetFullness(val OptFloat64)

SetFullness sets the value of Fullness.

func (*ClusterDisk) SetID

func (s *ClusterDisk) SetID(val string)

SetID sets the value of ID.

func (*ClusterDisk) SetTotalBytes

func (s *ClusterDisk) SetTotalBytes(val OptInt64)

SetTotalBytes sets the value of TotalBytes.

func (*ClusterDisk) SetWeight

func (s *ClusterDisk) SetWeight(val float64)

SetWeight sets the value of Weight.

func (*ClusterDisk) UnmarshalJSON

func (s *ClusterDisk) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ClusterDisk) Validate

func (s *ClusterDisk) Validate() error

type ClusterNode

type ClusterNode struct {
	ID string `json:"id"`
	// Peer address the node advertises.
	Addr OptString `json:"addr"`
	// Failure-domain label.
	Rack  OptString     `json:"rack"`
	Disks []ClusterDisk `json:"disks"`
}

Ref: #/components/schemas/ClusterNode

func (*ClusterNode) Decode

func (s *ClusterNode) Decode(d *jx.Decoder) error

Decode decodes ClusterNode from json.

func (*ClusterNode) Encode

func (s *ClusterNode) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*ClusterNode) GetAddr

func (s *ClusterNode) GetAddr() OptString

GetAddr returns the value of Addr.

func (*ClusterNode) GetDisks

func (s *ClusterNode) GetDisks() []ClusterDisk

GetDisks returns the value of Disks.

func (*ClusterNode) GetID

func (s *ClusterNode) GetID() string

GetID returns the value of ID.

func (*ClusterNode) GetRack

func (s *ClusterNode) GetRack() OptString

GetRack returns the value of Rack.

func (*ClusterNode) MarshalJSON

func (s *ClusterNode) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ClusterNode) SetAddr

func (s *ClusterNode) SetAddr(val OptString)

SetAddr sets the value of Addr.

func (*ClusterNode) SetDisks

func (s *ClusterNode) SetDisks(val []ClusterDisk)

SetDisks sets the value of Disks.

func (*ClusterNode) SetID

func (s *ClusterNode) SetID(val string)

SetID sets the value of ID.

func (*ClusterNode) SetRack

func (s *ClusterNode) SetRack(val OptString)

SetRack sets the value of Rack.

func (*ClusterNode) UnmarshalJSON

func (s *ClusterNode) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ClusterNode) Validate

func (s *ClusterNode) Validate() error

type ClusterState

type ClusterState string

"disabled" when the server is not in cluster mode. Ref: #/components/schemas/ClusterState

const (
	ClusterStateDisabled ClusterState = "disabled"
	ClusterStateOk       ClusterState = "ok"
)

func (ClusterState) AllValues

func (ClusterState) AllValues() []ClusterState

AllValues returns all ClusterState values.

func (*ClusterState) Decode

func (s *ClusterState) Decode(d *jx.Decoder) error

Decode decodes ClusterState from json.

func (ClusterState) Encode

func (s ClusterState) Encode(e *jx.Encoder)

Encode encodes ClusterState as json.

func (ClusterState) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (ClusterState) MarshalText

func (s ClusterState) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*ClusterState) UnmarshalJSON

func (s *ClusterState) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ClusterState) UnmarshalText

func (s *ClusterState) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (ClusterState) Validate

func (s ClusterState) Validate() error

type ClusterStatus

type ClusterStatus struct {
	State ClusterState `json:"state"`
	// Schema version the cluster has agreed on (etcd).
	SchemaVersion int `json:"schema_version"`
	// Schema version this binary implements.
	BinarySchemaVersion int `json:"binary_schema_version"`
	NodeCount           int `json:"node_count"`
	DiskCount           int `json:"disk_count"`
	// Sum of reported disk capacity across the cluster.
	TotalBytes int64 `json:"total_bytes"`
	FreeBytes  int64 `json:"free_bytes"`
	// Max minus min disk fullness across disks reporting capacity.
	PlacementSkew float64 `json:"placement_skew"`
	// Whether a rebalance runner currently holds the cluster-wide election.
	RebalanceRunning bool `json:"rebalance_running"`
	// Resume cursor of an in-progress/last rebalance, if any.
	RebalanceCursorBucket OptString     `json:"rebalance_cursor_bucket"`
	RebalanceCursorKey    OptString     `json:"rebalance_cursor_key"`
	Nodes                 []ClusterNode `json:"nodes"`
}

Ref: #/components/schemas/ClusterStatus

func (*ClusterStatus) Decode

func (s *ClusterStatus) Decode(d *jx.Decoder) error

Decode decodes ClusterStatus from json.

func (*ClusterStatus) Encode

func (s *ClusterStatus) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*ClusterStatus) GetBinarySchemaVersion

func (s *ClusterStatus) GetBinarySchemaVersion() int

GetBinarySchemaVersion returns the value of BinarySchemaVersion.

func (*ClusterStatus) GetDiskCount

func (s *ClusterStatus) GetDiskCount() int

GetDiskCount returns the value of DiskCount.

func (*ClusterStatus) GetFreeBytes

func (s *ClusterStatus) GetFreeBytes() int64

GetFreeBytes returns the value of FreeBytes.

func (*ClusterStatus) GetNodeCount

func (s *ClusterStatus) GetNodeCount() int

GetNodeCount returns the value of NodeCount.

func (*ClusterStatus) GetNodes

func (s *ClusterStatus) GetNodes() []ClusterNode

GetNodes returns the value of Nodes.

func (*ClusterStatus) GetPlacementSkew

func (s *ClusterStatus) GetPlacementSkew() float64

GetPlacementSkew returns the value of PlacementSkew.

func (*ClusterStatus) GetRebalanceCursorBucket

func (s *ClusterStatus) GetRebalanceCursorBucket() OptString

GetRebalanceCursorBucket returns the value of RebalanceCursorBucket.

func (*ClusterStatus) GetRebalanceCursorKey

func (s *ClusterStatus) GetRebalanceCursorKey() OptString

GetRebalanceCursorKey returns the value of RebalanceCursorKey.

func (*ClusterStatus) GetRebalanceRunning

func (s *ClusterStatus) GetRebalanceRunning() bool

GetRebalanceRunning returns the value of RebalanceRunning.

func (*ClusterStatus) GetSchemaVersion

func (s *ClusterStatus) GetSchemaVersion() int

GetSchemaVersion returns the value of SchemaVersion.

func (*ClusterStatus) GetState

func (s *ClusterStatus) GetState() ClusterState

GetState returns the value of State.

func (*ClusterStatus) GetTotalBytes

func (s *ClusterStatus) GetTotalBytes() int64

GetTotalBytes returns the value of TotalBytes.

func (*ClusterStatus) MarshalJSON

func (s *ClusterStatus) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ClusterStatus) SetBinarySchemaVersion

func (s *ClusterStatus) SetBinarySchemaVersion(val int)

SetBinarySchemaVersion sets the value of BinarySchemaVersion.

func (*ClusterStatus) SetDiskCount

func (s *ClusterStatus) SetDiskCount(val int)

SetDiskCount sets the value of DiskCount.

func (*ClusterStatus) SetFreeBytes

func (s *ClusterStatus) SetFreeBytes(val int64)

SetFreeBytes sets the value of FreeBytes.

func (*ClusterStatus) SetNodeCount

func (s *ClusterStatus) SetNodeCount(val int)

SetNodeCount sets the value of NodeCount.

func (*ClusterStatus) SetNodes

func (s *ClusterStatus) SetNodes(val []ClusterNode)

SetNodes sets the value of Nodes.

func (*ClusterStatus) SetPlacementSkew

func (s *ClusterStatus) SetPlacementSkew(val float64)

SetPlacementSkew sets the value of PlacementSkew.

func (*ClusterStatus) SetRebalanceCursorBucket

func (s *ClusterStatus) SetRebalanceCursorBucket(val OptString)

SetRebalanceCursorBucket sets the value of RebalanceCursorBucket.

func (*ClusterStatus) SetRebalanceCursorKey

func (s *ClusterStatus) SetRebalanceCursorKey(val OptString)

SetRebalanceCursorKey sets the value of RebalanceCursorKey.

func (*ClusterStatus) SetRebalanceRunning

func (s *ClusterStatus) SetRebalanceRunning(val bool)

SetRebalanceRunning sets the value of RebalanceRunning.

func (*ClusterStatus) SetSchemaVersion

func (s *ClusterStatus) SetSchemaVersion(val int)

SetSchemaVersion sets the value of SchemaVersion.

func (*ClusterStatus) SetState

func (s *ClusterStatus) SetState(val ClusterState)

SetState sets the value of State.

func (*ClusterStatus) SetTotalBytes

func (s *ClusterStatus) SetTotalBytes(val int64)

SetTotalBytes sets the value of TotalBytes.

func (*ClusterStatus) UnmarshalJSON

func (s *ClusterStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ClusterStatus) Validate

func (s *ClusterStatus) Validate() error

type CreateAccessKeyRequest

type CreateAccessKeyRequest struct {
	// Access key ID; generated when omitted.
	AccessKey OptString `json:"access_key"`
	// Secret access key; generated when omitted.
	SecretKey OptString `json:"secret_key"`
	Grants    []Grant   `json:"grants"`
}

Ref: #/components/schemas/CreateAccessKeyRequest

func (*CreateAccessKeyRequest) Decode

func (s *CreateAccessKeyRequest) Decode(d *jx.Decoder) error

Decode decodes CreateAccessKeyRequest from json.

func (*CreateAccessKeyRequest) Encode

func (s *CreateAccessKeyRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateAccessKeyRequest) GetAccessKey

func (s *CreateAccessKeyRequest) GetAccessKey() OptString

GetAccessKey returns the value of AccessKey.

func (*CreateAccessKeyRequest) GetGrants

func (s *CreateAccessKeyRequest) GetGrants() []Grant

GetGrants returns the value of Grants.

func (*CreateAccessKeyRequest) GetSecretKey

func (s *CreateAccessKeyRequest) GetSecretKey() OptString

GetSecretKey returns the value of SecretKey.

func (*CreateAccessKeyRequest) MarshalJSON

func (s *CreateAccessKeyRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateAccessKeyRequest) SetAccessKey

func (s *CreateAccessKeyRequest) SetAccessKey(val OptString)

SetAccessKey sets the value of AccessKey.

func (*CreateAccessKeyRequest) SetGrants

func (s *CreateAccessKeyRequest) SetGrants(val []Grant)

SetGrants sets the value of Grants.

func (*CreateAccessKeyRequest) SetSecretKey

func (s *CreateAccessKeyRequest) SetSecretKey(val OptString)

SetSecretKey sets the value of SecretKey.

func (*CreateAccessKeyRequest) UnmarshalJSON

func (s *CreateAccessKeyRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateAccessKeyRequest) Validate

func (s *CreateAccessKeyRequest) Validate() error

type CreatedAccessKey

type CreatedAccessKey struct {
	AccessKey string `json:"access_key"`
	// Secret access key — shown once, not retrievable later.
	SecretKey string    `json:"secret_key"`
	Grants    []Grant   `json:"grants"`
	CreatedAt time.Time `json:"created_at"`
}

Ref: #/components/schemas/CreatedAccessKey

func (*CreatedAccessKey) Decode

func (s *CreatedAccessKey) Decode(d *jx.Decoder) error

Decode decodes CreatedAccessKey from json.

func (*CreatedAccessKey) Encode

func (s *CreatedAccessKey) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreatedAccessKey) GetAccessKey

func (s *CreatedAccessKey) GetAccessKey() string

GetAccessKey returns the value of AccessKey.

func (*CreatedAccessKey) GetCreatedAt

func (s *CreatedAccessKey) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*CreatedAccessKey) GetGrants

func (s *CreatedAccessKey) GetGrants() []Grant

GetGrants returns the value of Grants.

func (*CreatedAccessKey) GetSecretKey

func (s *CreatedAccessKey) GetSecretKey() string

GetSecretKey returns the value of SecretKey.

func (*CreatedAccessKey) MarshalJSON

func (s *CreatedAccessKey) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreatedAccessKey) SetAccessKey

func (s *CreatedAccessKey) SetAccessKey(val string)

SetAccessKey sets the value of AccessKey.

func (*CreatedAccessKey) SetCreatedAt

func (s *CreatedAccessKey) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*CreatedAccessKey) SetGrants

func (s *CreatedAccessKey) SetGrants(val []Grant)

SetGrants sets the value of Grants.

func (*CreatedAccessKey) SetSecretKey

func (s *CreatedAccessKey) SetSecretKey(val string)

SetSecretKey sets the value of SecretKey.

func (*CreatedAccessKey) UnmarshalJSON

func (s *CreatedAccessKey) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreatedAccessKey) Validate

func (s *CreatedAccessKey) Validate() error

type DeleteAccessKeyNoContent

type DeleteAccessKeyNoContent struct{}

DeleteAccessKeyNoContent is response for DeleteAccessKey operation.

type DeleteAccessKeyParams

type DeleteAccessKeyParams struct {
	// The access key ID to delete.
	AccessKey string
}

DeleteAccessKeyParams is parameters of deleteAccessKey operation.

type Error

type Error struct {
	ErrorMessage string `json:"error_message"`
}

Error occurred while processing request. Ref: #/components/schemas/Error

func (*Error) Decode

func (s *Error) Decode(d *jx.Decoder) error

Decode decodes Error from json.

func (*Error) Encode

func (s *Error) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Error) GetErrorMessage

func (s *Error) GetErrorMessage() string

GetErrorMessage returns the value of ErrorMessage.

func (*Error) MarshalJSON

func (s *Error) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Error) SetErrorMessage

func (s *Error) SetErrorMessage(val string)

SetErrorMessage sets the value of ErrorMessage.

func (*Error) UnmarshalJSON

func (s *Error) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type ErrorHandler

type ErrorHandler = ogenerrors.ErrorHandler

ErrorHandler is error handler.

type ErrorStatusCode

type ErrorStatusCode struct {
	StatusCode int
	Response   Error
}

ErrorStatusCode wraps Error with StatusCode.

func (*ErrorStatusCode) Error

func (s *ErrorStatusCode) Error() string

func (*ErrorStatusCode) GetResponse

func (s *ErrorStatusCode) GetResponse() Error

GetResponse returns the value of Response.

func (*ErrorStatusCode) GetStatusCode

func (s *ErrorStatusCode) GetStatusCode() int

GetStatusCode returns the value of StatusCode.

func (*ErrorStatusCode) SetResponse

func (s *ErrorStatusCode) SetResponse(val Error)

SetResponse sets the value of Response.

func (*ErrorStatusCode) SetStatusCode

func (s *ErrorStatusCode) SetStatusCode(val int)

SetStatusCode sets the value of StatusCode.

type GetBucketSchemeParams added in v0.7.0

type GetBucketSchemeParams struct {
	// The bucket name.
	Bucket string
}

GetBucketSchemeParams is parameters of getBucketScheme operation.

type Grant

type Grant struct {
	// Bucket glob pattern; "*" matches all buckets.
	Bucket     string     `json:"bucket"`
	Permission Permission `json:"permission"`
}

Ref: #/components/schemas/Grant

func (*Grant) Decode

func (s *Grant) Decode(d *jx.Decoder) error

Decode decodes Grant from json.

func (*Grant) Encode

func (s *Grant) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Grant) GetBucket

func (s *Grant) GetBucket() string

GetBucket returns the value of Bucket.

func (*Grant) GetPermission

func (s *Grant) GetPermission() Permission

GetPermission returns the value of Permission.

func (*Grant) MarshalJSON

func (s *Grant) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Grant) SetBucket

func (s *Grant) SetBucket(val string)

SetBucket sets the value of Bucket.

func (*Grant) SetPermission

func (s *Grant) SetPermission(val Permission)

SetPermission sets the value of Permission.

func (*Grant) UnmarshalJSON

func (s *Grant) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Grant) Validate

func (s *Grant) Validate() error

type Handler

type Handler interface {
	// ControlRebalance implements controlRebalance operation.
	//
	// Start, pause or resume the cluster-wide rebalance from this node. At most one rebalance runs
	// cluster-wide (etcd election); starting on several nodes leaves the extras waiting as standby
	// runners. Pausing stops this node's runner and keeps the resume cursor, so a later start/resume —
	// on any node — continues where it left off.
	//
	// POST /api/v1/cluster/rebalance
	ControlRebalance(ctx context.Context, req *RebalanceControlRequest) (*RebalanceStatus, error)
	// CreateAccessKey implements createAccessKey operation.
	//
	// Create a runtime credential. The access key and secret are generated when not supplied. The secret
	// is returned only in this response and cannot be retrieved later.
	//
	// POST /api/v1/access-keys
	CreateAccessKey(ctx context.Context, req *CreateAccessKeyRequest) (*CreatedAccessKey, error)
	// DeleteAccessKey implements deleteAccessKey operation.
	//
	// Remove a runtime credential. Config-defined credentials cannot be deleted.
	//
	// DELETE /api/v1/access-keys/{accessKey}
	DeleteAccessKey(ctx context.Context, params DeleteAccessKeyParams) error
	// GetBucketScheme implements getBucketScheme operation.
	//
	// The bucket's effective replication scheme, its explicit override (empty when the bucket follows the
	// cluster default) and the cluster default. Returns 404 when the bucket does not exist and 501 when
	// the server is not in cluster mode (a single-node server has no per-bucket schemes).
	//
	// GET /api/v1/buckets/{bucket}/scheme
	GetBucketScheme(ctx context.Context, params GetBucketSchemeParams) (*BucketScheme, error)
	// GetClusterStatus implements getClusterStatus operation.
	//
	// Cluster-wide view read from the control plane: the agreed schema version, every node with its disks
	// and reported capacity, aggregate capacity, placement skew and whether a rebalance is currently
	// running. State is "disabled" when the server is not in cluster mode.
	//
	// GET /api/v1/cluster/status
	GetClusterStatus(ctx context.Context) (*ClusterStatus, error)
	// GetInfo implements getInfo operation.
	//
	// Build information, uptime and whether authentication is enabled.
	//
	// GET /api/v1/info
	GetInfo(ctx context.Context) (*InstanceInfo, error)
	// GetPublicReadBuckets implements getPublicReadBuckets operation.
	//
	// Buckets readable anonymously (unsigned GET/HEAD/list), cluster-wide. Available only with
	// cluster-wide credentials (auth.source: etcd); returns 501 otherwise, where public-read buckets are
	// managed in the config file per node.
	//
	// GET /api/v1/public-read-buckets
	GetPublicReadBuckets(ctx context.Context) (*PublicReadBuckets, error)
	// GetRebalanceStatus implements getRebalanceStatus operation.
	//
	// State and progress of the cluster rebalance runner on this node, the persisted resume cursor and the
	// depth of the async repair queue. State is "disabled" when the server is not in cluster mode.
	//
	// GET /api/v1/cluster/rebalance
	GetRebalanceStatus(ctx context.Context) (*RebalanceStatus, error)
	// ListAccessKeys implements listAccessKeys operation.
	//
	// Every credential the server accepts, secrets omitted.
	//
	// GET /api/v1/access-keys
	ListAccessKeys(ctx context.Context) (*AccessKeyList, error)
	// ReloadConfig implements reloadConfig operation.
	//
	// Re-read the configuration file and apply the parts that change without a restart — the
	// config-defined credentials and grants, the anonymously readable buckets and the TLS certificate —
	// exactly as SIGHUP does. Runtime credentials created through this API are preserved. Returns what was
	// reloaded and the config revision now in effect, so an orchestrator can confirm a config change
	// landed without shelling into the process. Returns 501 on a listener with nothing to reload (the
	// headless cluster admin serves no S3 data).
	//
	// POST /api/v1/reload
	ReloadConfig(ctx context.Context) (*ReloadResult, error)
	// SetBucketScheme implements setBucketScheme operation.
	//
	// Override the bucket's replication scheme, or clear the override to restore the cluster default. The
	// scheme must parse ("rf2.5", "rf3" or "ec:k,m") and the current topology must be able to host it. The
	// change affects new writes cluster-wide within seconds; existing objects convert through
	// repair/rebalance. Returns the effective scheme after applying. Returns 400 when the scheme is
	// invalid or the topology cannot host it, 404 when the bucket does not exist and 501 when the server
	// is not in cluster mode.
	//
	// PUT /api/v1/buckets/{bucket}/scheme
	SetBucketScheme(ctx context.Context, req *SetBucketSchemeRequest, params SetBucketSchemeParams) (*BucketScheme, error)
	// SetPublicReadBuckets implements setPublicReadBuckets operation.
	//
	// Replace the cluster-wide public-read bucket list. The change propagates to every node within seconds
	// with no restart. Returns the stored list. Returns 400 on an invalid bucket name and 501 when not
	// using cluster-wide credentials.
	//
	// PUT /api/v1/public-read-buckets
	SetPublicReadBuckets(ctx context.Context, req *SetPublicReadBucketsRequest) (*PublicReadBuckets, error)
	// NewError creates *ErrorStatusCode from error returned by handler.
	//
	// Used for common default response.
	NewError(ctx context.Context, err error) *ErrorStatusCode
}

Handler handles operations described by OpenAPI v3 specification.

type InstanceInfo

type InstanceInfo struct {
	Version       string    `json:"version"`
	Commit        string    `json:"commit"`
	GoVersion     string    `json:"go_version"`
	Os            string    `json:"os"`
	Arch          string    `json:"arch"`
	StartTime     time.Time `json:"start_time"`
	UptimeSeconds float64   `json:"uptime_seconds"`
	// Whether SigV4 authentication is enabled.
	AuthEnabled bool `json:"auth_enabled"`
	// Opaque marker echoed from the loaded config file's "revision" field, updated on reload. Empty when
	// the config sets none. An orchestrator writes a revision into each node's config and reads it back
	// here to confirm the node has applied that revision.
	ConfigRevision OptString `json:"config_revision"`
}

Ref: #/components/schemas/InstanceInfo

func (*InstanceInfo) Decode

func (s *InstanceInfo) Decode(d *jx.Decoder) error

Decode decodes InstanceInfo from json.

func (*InstanceInfo) Encode

func (s *InstanceInfo) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*InstanceInfo) GetArch

func (s *InstanceInfo) GetArch() string

GetArch returns the value of Arch.

func (*InstanceInfo) GetAuthEnabled

func (s *InstanceInfo) GetAuthEnabled() bool

GetAuthEnabled returns the value of AuthEnabled.

func (*InstanceInfo) GetCommit

func (s *InstanceInfo) GetCommit() string

GetCommit returns the value of Commit.

func (*InstanceInfo) GetConfigRevision

func (s *InstanceInfo) GetConfigRevision() OptString

GetConfigRevision returns the value of ConfigRevision.

func (*InstanceInfo) GetGoVersion

func (s *InstanceInfo) GetGoVersion() string

GetGoVersion returns the value of GoVersion.

func (*InstanceInfo) GetOs

func (s *InstanceInfo) GetOs() string

GetOs returns the value of Os.

func (*InstanceInfo) GetStartTime

func (s *InstanceInfo) GetStartTime() time.Time

GetStartTime returns the value of StartTime.

func (*InstanceInfo) GetUptimeSeconds

func (s *InstanceInfo) GetUptimeSeconds() float64

GetUptimeSeconds returns the value of UptimeSeconds.

func (*InstanceInfo) GetVersion

func (s *InstanceInfo) GetVersion() string

GetVersion returns the value of Version.

func (*InstanceInfo) MarshalJSON

func (s *InstanceInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*InstanceInfo) SetArch

func (s *InstanceInfo) SetArch(val string)

SetArch sets the value of Arch.

func (*InstanceInfo) SetAuthEnabled

func (s *InstanceInfo) SetAuthEnabled(val bool)

SetAuthEnabled sets the value of AuthEnabled.

func (*InstanceInfo) SetCommit

func (s *InstanceInfo) SetCommit(val string)

SetCommit sets the value of Commit.

func (*InstanceInfo) SetConfigRevision

func (s *InstanceInfo) SetConfigRevision(val OptString)

SetConfigRevision sets the value of ConfigRevision.

func (*InstanceInfo) SetGoVersion

func (s *InstanceInfo) SetGoVersion(val string)

SetGoVersion sets the value of GoVersion.

func (*InstanceInfo) SetOs

func (s *InstanceInfo) SetOs(val string)

SetOs sets the value of Os.

func (*InstanceInfo) SetStartTime

func (s *InstanceInfo) SetStartTime(val time.Time)

SetStartTime sets the value of StartTime.

func (*InstanceInfo) SetUptimeSeconds

func (s *InstanceInfo) SetUptimeSeconds(val float64)

SetUptimeSeconds sets the value of UptimeSeconds.

func (*InstanceInfo) SetVersion

func (s *InstanceInfo) SetVersion(val string)

SetVersion sets the value of Version.

func (*InstanceInfo) UnmarshalJSON

func (s *InstanceInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*InstanceInfo) Validate

func (s *InstanceInfo) Validate() error

type Invoker

type Invoker interface {
	// ControlRebalance invokes controlRebalance operation.
	//
	// Start, pause or resume the cluster-wide rebalance from this node. At most one rebalance runs
	// cluster-wide (etcd election); starting on several nodes leaves the extras waiting as standby
	// runners. Pausing stops this node's runner and keeps the resume cursor, so a later start/resume —
	// on any node — continues where it left off.
	//
	// POST /api/v1/cluster/rebalance
	ControlRebalance(ctx context.Context, request *RebalanceControlRequest) (*RebalanceStatus, error)
	// CreateAccessKey invokes createAccessKey operation.
	//
	// Create a runtime credential. The access key and secret are generated when not supplied. The secret
	// is returned only in this response and cannot be retrieved later.
	//
	// POST /api/v1/access-keys
	CreateAccessKey(ctx context.Context, request *CreateAccessKeyRequest) (*CreatedAccessKey, error)
	// DeleteAccessKey invokes deleteAccessKey operation.
	//
	// Remove a runtime credential. Config-defined credentials cannot be deleted.
	//
	// DELETE /api/v1/access-keys/{accessKey}
	DeleteAccessKey(ctx context.Context, params DeleteAccessKeyParams) error
	// GetBucketScheme invokes getBucketScheme operation.
	//
	// The bucket's effective replication scheme, its explicit override (empty when the bucket follows the
	// cluster default) and the cluster default. Returns 404 when the bucket does not exist and 501 when
	// the server is not in cluster mode (a single-node server has no per-bucket schemes).
	//
	// GET /api/v1/buckets/{bucket}/scheme
	GetBucketScheme(ctx context.Context, params GetBucketSchemeParams) (*BucketScheme, error)
	// GetClusterStatus invokes getClusterStatus operation.
	//
	// Cluster-wide view read from the control plane: the agreed schema version, every node with its disks
	// and reported capacity, aggregate capacity, placement skew and whether a rebalance is currently
	// running. State is "disabled" when the server is not in cluster mode.
	//
	// GET /api/v1/cluster/status
	GetClusterStatus(ctx context.Context) (*ClusterStatus, error)
	// GetInfo invokes getInfo operation.
	//
	// Build information, uptime and whether authentication is enabled.
	//
	// GET /api/v1/info
	GetInfo(ctx context.Context) (*InstanceInfo, error)
	// GetPublicReadBuckets invokes getPublicReadBuckets operation.
	//
	// Buckets readable anonymously (unsigned GET/HEAD/list), cluster-wide. Available only with
	// cluster-wide credentials (auth.source: etcd); returns 501 otherwise, where public-read buckets are
	// managed in the config file per node.
	//
	// GET /api/v1/public-read-buckets
	GetPublicReadBuckets(ctx context.Context) (*PublicReadBuckets, error)
	// GetRebalanceStatus invokes getRebalanceStatus operation.
	//
	// State and progress of the cluster rebalance runner on this node, the persisted resume cursor and the
	// depth of the async repair queue. State is "disabled" when the server is not in cluster mode.
	//
	// GET /api/v1/cluster/rebalance
	GetRebalanceStatus(ctx context.Context) (*RebalanceStatus, error)
	// ListAccessKeys invokes listAccessKeys operation.
	//
	// Every credential the server accepts, secrets omitted.
	//
	// GET /api/v1/access-keys
	ListAccessKeys(ctx context.Context) (*AccessKeyList, error)
	// ReloadConfig invokes reloadConfig operation.
	//
	// Re-read the configuration file and apply the parts that change without a restart — the
	// config-defined credentials and grants, the anonymously readable buckets and the TLS certificate —
	// exactly as SIGHUP does. Runtime credentials created through this API are preserved. Returns what was
	// reloaded and the config revision now in effect, so an orchestrator can confirm a config change
	// landed without shelling into the process. Returns 501 on a listener with nothing to reload (the
	// headless cluster admin serves no S3 data).
	//
	// POST /api/v1/reload
	ReloadConfig(ctx context.Context) (*ReloadResult, error)
	// SetBucketScheme invokes setBucketScheme operation.
	//
	// Override the bucket's replication scheme, or clear the override to restore the cluster default. The
	// scheme must parse ("rf2.5", "rf3" or "ec:k,m") and the current topology must be able to host it. The
	// change affects new writes cluster-wide within seconds; existing objects convert through
	// repair/rebalance. Returns the effective scheme after applying. Returns 400 when the scheme is
	// invalid or the topology cannot host it, 404 when the bucket does not exist and 501 when the server
	// is not in cluster mode.
	//
	// PUT /api/v1/buckets/{bucket}/scheme
	SetBucketScheme(ctx context.Context, request *SetBucketSchemeRequest, params SetBucketSchemeParams) (*BucketScheme, error)
	// SetPublicReadBuckets invokes setPublicReadBuckets operation.
	//
	// Replace the cluster-wide public-read bucket list. The change propagates to every node within seconds
	// with no restart. Returns the stored list. Returns 400 on an invalid bucket name and 501 when not
	// using cluster-wide credentials.
	//
	// PUT /api/v1/public-read-buckets
	SetPublicReadBuckets(ctx context.Context, request *SetPublicReadBucketsRequest) (*PublicReadBuckets, error)
}

Invoker invokes operations described by OpenAPI v3 specification.

type Labeler

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

Labeler is used to allow adding custom attributes to the server request metrics.

func LabelerFromContext

func LabelerFromContext(ctx context.Context) (*Labeler, bool)

LabelerFromContext retrieves the Labeler from the provided context, if present.

If no Labeler was found in the provided context a new, empty Labeler is returned and the second return value is false. In this case it is safe to use the Labeler but any attributes added to it will not be used.

func (*Labeler) Add

func (l *Labeler) Add(attrs ...attribute.KeyValue)

Add attributes to the Labeler.

func (*Labeler) AttributeSet

func (l *Labeler) AttributeSet() attribute.Set

AttributeSet returns the attributes added to the Labeler as an attribute.Set.

type Middleware

type Middleware = middleware.Middleware

Middleware is middleware type.

type OperationName

type OperationName = string

OperationName is the ogen operation name

const (
	ControlRebalanceOperation     OperationName = "ControlRebalance"
	CreateAccessKeyOperation      OperationName = "CreateAccessKey"
	DeleteAccessKeyOperation      OperationName = "DeleteAccessKey"
	GetBucketSchemeOperation      OperationName = "GetBucketScheme"
	GetClusterStatusOperation     OperationName = "GetClusterStatus"
	GetInfoOperation              OperationName = "GetInfo"
	GetPublicReadBucketsOperation OperationName = "GetPublicReadBuckets"
	GetRebalanceStatusOperation   OperationName = "GetRebalanceStatus"
	ListAccessKeysOperation       OperationName = "ListAccessKeys"
	ReloadConfigOperation         OperationName = "ReloadConfig"
	SetBucketSchemeOperation      OperationName = "SetBucketScheme"
	SetPublicReadBucketsOperation OperationName = "SetPublicReadBuckets"
)

type OptDateTime

type OptDateTime struct {
	Value time.Time
	Set   bool
}

OptDateTime is optional time.Time.

func NewOptDateTime

func NewOptDateTime(v time.Time) OptDateTime

NewOptDateTime returns new OptDateTime with value set to v.

func (*OptDateTime) Decode

func (o *OptDateTime) Decode(d *jx.Decoder, format func(*jx.Decoder) (time.Time, error)) error

Decode decodes time.Time from json.

func (OptDateTime) Encode

func (o OptDateTime) Encode(e *jx.Encoder, format func(*jx.Encoder, time.Time))

Encode encodes time.Time as json.

func (OptDateTime) Get

func (o OptDateTime) Get() (v time.Time, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptDateTime) IsSet

func (o OptDateTime) IsSet() bool

IsSet returns true if OptDateTime was set.

func (OptDateTime) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptDateTime) Or

func (o OptDateTime) Or(d time.Time) time.Time

Or returns value if set, or given parameter if does not.

func (*OptDateTime) Reset

func (o *OptDateTime) Reset()

Reset unsets value.

func (*OptDateTime) SetTo

func (o *OptDateTime) SetTo(v time.Time)

SetTo sets value to v.

func (*OptDateTime) UnmarshalJSON

func (s *OptDateTime) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptFloat64

type OptFloat64 struct {
	Value float64
	Set   bool
}

OptFloat64 is optional float64.

func NewOptFloat64

func NewOptFloat64(v float64) OptFloat64

NewOptFloat64 returns new OptFloat64 with value set to v.

func (*OptFloat64) Decode

func (o *OptFloat64) Decode(d *jx.Decoder) error

Decode decodes float64 from json.

func (OptFloat64) Encode

func (o OptFloat64) Encode(e *jx.Encoder)

Encode encodes float64 as json.

func (OptFloat64) Get

func (o OptFloat64) Get() (v float64, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptFloat64) IsSet

func (o OptFloat64) IsSet() bool

IsSet returns true if OptFloat64 was set.

func (OptFloat64) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptFloat64) Or

func (o OptFloat64) Or(d float64) float64

Or returns value if set, or given parameter if does not.

func (*OptFloat64) Reset

func (o *OptFloat64) Reset()

Reset unsets value.

func (*OptFloat64) SetTo

func (o *OptFloat64) SetTo(v float64)

SetTo sets value to v.

func (*OptFloat64) UnmarshalJSON

func (s *OptFloat64) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptInt64

type OptInt64 struct {
	Value int64
	Set   bool
}

OptInt64 is optional int64.

func NewOptInt64

func NewOptInt64(v int64) OptInt64

NewOptInt64 returns new OptInt64 with value set to v.

func (*OptInt64) Decode

func (o *OptInt64) Decode(d *jx.Decoder) error

Decode decodes int64 from json.

func (OptInt64) Encode

func (o OptInt64) Encode(e *jx.Encoder)

Encode encodes int64 as json.

func (OptInt64) Get

func (o OptInt64) Get() (v int64, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptInt64) IsSet

func (o OptInt64) IsSet() bool

IsSet returns true if OptInt64 was set.

func (OptInt64) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptInt64) Or

func (o OptInt64) Or(d int64) int64

Or returns value if set, or given parameter if does not.

func (*OptInt64) Reset

func (o *OptInt64) Reset()

Reset unsets value.

func (*OptInt64) SetTo

func (o *OptInt64) SetTo(v int64)

SetTo sets value to v.

func (*OptInt64) UnmarshalJSON

func (s *OptInt64) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptString

type OptString struct {
	Value string
	Set   bool
}

OptString is optional string.

func NewOptString

func NewOptString(v string) OptString

NewOptString returns new OptString with value set to v.

func (*OptString) Decode

func (o *OptString) Decode(d *jx.Decoder) error

Decode decodes string from json.

func (OptString) Encode

func (o OptString) Encode(e *jx.Encoder)

Encode encodes string as json.

func (OptString) Get

func (o OptString) Get() (v string, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptString) IsSet

func (o OptString) IsSet() bool

IsSet returns true if OptString was set.

func (OptString) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptString) Or

func (o OptString) Or(d string) string

Or returns value if set, or given parameter if does not.

func (*OptString) Reset

func (o *OptString) Reset()

Reset unsets value.

func (*OptString) SetTo

func (o *OptString) SetTo(v string)

SetTo sets value to v.

func (*OptString) UnmarshalJSON

func (s *OptString) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Option

type Option interface {
	ServerOption
	ClientOption
}

Option is config option.

func WithAttributes

func WithAttributes(attributes ...attribute.KeyValue) Option

WithAttributes specifies default otel attributes.

func WithMeterProvider

func WithMeterProvider(provider metric.MeterProvider) Option

WithMeterProvider specifies a meter provider to use for creating a meter.

If none is specified, the otel.GetMeterProvider() is used.

func WithTracerProvider

func WithTracerProvider(provider trace.TracerProvider) Option

WithTracerProvider specifies a tracer provider to use for creating a tracer.

If none is specified, the global provider is used.

type Permission

type Permission string

Access level; Admin includes Write includes Read. Ref: #/components/schemas/Permission

const (
	PermissionRead  Permission = "read"
	PermissionWrite Permission = "write"
	PermissionAdmin Permission = "admin"
)

func (Permission) AllValues

func (Permission) AllValues() []Permission

AllValues returns all Permission values.

func (*Permission) Decode

func (s *Permission) Decode(d *jx.Decoder) error

Decode decodes Permission from json.

func (Permission) Encode

func (s Permission) Encode(e *jx.Encoder)

Encode encodes Permission as json.

func (Permission) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (Permission) MarshalText

func (s Permission) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*Permission) UnmarshalJSON

func (s *Permission) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Permission) UnmarshalText

func (s *Permission) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (Permission) Validate

func (s Permission) Validate() error

type PublicReadBuckets added in v0.8.0

type PublicReadBuckets struct {
	// Bucket names readable without credentials.
	Buckets []string `json:"buckets"`
}

The cluster-wide list of anonymously-readable buckets. Ref: #/components/schemas/PublicReadBuckets

func (*PublicReadBuckets) Decode added in v0.8.0

func (s *PublicReadBuckets) Decode(d *jx.Decoder) error

Decode decodes PublicReadBuckets from json.

func (*PublicReadBuckets) Encode added in v0.8.0

func (s *PublicReadBuckets) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*PublicReadBuckets) GetBuckets added in v0.8.0

func (s *PublicReadBuckets) GetBuckets() []string

GetBuckets returns the value of Buckets.

func (*PublicReadBuckets) MarshalJSON added in v0.8.0

func (s *PublicReadBuckets) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PublicReadBuckets) SetBuckets added in v0.8.0

func (s *PublicReadBuckets) SetBuckets(val []string)

SetBuckets sets the value of Buckets.

func (*PublicReadBuckets) UnmarshalJSON added in v0.8.0

func (s *PublicReadBuckets) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*PublicReadBuckets) Validate added in v0.8.0

func (s *PublicReadBuckets) Validate() error

type RebalanceAction

type RebalanceAction string

Ref: #/components/schemas/RebalanceAction

const (
	RebalanceActionStart  RebalanceAction = "start"
	RebalanceActionPause  RebalanceAction = "pause"
	RebalanceActionResume RebalanceAction = "resume"
)

func (RebalanceAction) AllValues

func (RebalanceAction) AllValues() []RebalanceAction

AllValues returns all RebalanceAction values.

func (*RebalanceAction) Decode

func (s *RebalanceAction) Decode(d *jx.Decoder) error

Decode decodes RebalanceAction from json.

func (RebalanceAction) Encode

func (s RebalanceAction) Encode(e *jx.Encoder)

Encode encodes RebalanceAction as json.

func (RebalanceAction) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (RebalanceAction) MarshalText

func (s RebalanceAction) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*RebalanceAction) UnmarshalJSON

func (s *RebalanceAction) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*RebalanceAction) UnmarshalText

func (s *RebalanceAction) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (RebalanceAction) Validate

func (s RebalanceAction) Validate() error

type RebalanceControlRequest

type RebalanceControlRequest struct {
	Action RebalanceAction `json:"action"`
}

Ref: #/components/schemas/RebalanceControlRequest

func (*RebalanceControlRequest) Decode

func (s *RebalanceControlRequest) Decode(d *jx.Decoder) error

Decode decodes RebalanceControlRequest from json.

func (*RebalanceControlRequest) Encode

func (s *RebalanceControlRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*RebalanceControlRequest) GetAction

GetAction returns the value of Action.

func (*RebalanceControlRequest) MarshalJSON

func (s *RebalanceControlRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*RebalanceControlRequest) SetAction

func (s *RebalanceControlRequest) SetAction(val RebalanceAction)

SetAction sets the value of Action.

func (*RebalanceControlRequest) UnmarshalJSON

func (s *RebalanceControlRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*RebalanceControlRequest) Validate

func (s *RebalanceControlRequest) Validate() error

type RebalanceState

type RebalanceState string

Runner state on this node: "disabled" (not cluster mode), "idle" (never started since boot), "waiting" (campaigning for the cluster-wide slot behind another runner), "running", "paused" (stopped by an operator, resume cursor kept), "done" (last run completed) or "failed" (last run aborted with an error). Ref: #/components/schemas/RebalanceState

const (
	RebalanceStateDisabled RebalanceState = "disabled"
	RebalanceStateIdle     RebalanceState = "idle"
	RebalanceStateWaiting  RebalanceState = "waiting"
	RebalanceStateRunning  RebalanceState = "running"
	RebalanceStatePaused   RebalanceState = "paused"
	RebalanceStateDone     RebalanceState = "done"
	RebalanceStateFailed   RebalanceState = "failed"
)

func (RebalanceState) AllValues

func (RebalanceState) AllValues() []RebalanceState

AllValues returns all RebalanceState values.

func (*RebalanceState) Decode

func (s *RebalanceState) Decode(d *jx.Decoder) error

Decode decodes RebalanceState from json.

func (RebalanceState) Encode

func (s RebalanceState) Encode(e *jx.Encoder)

Encode encodes RebalanceState as json.

func (RebalanceState) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (RebalanceState) MarshalText

func (s RebalanceState) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*RebalanceState) UnmarshalJSON

func (s *RebalanceState) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*RebalanceState) UnmarshalText

func (s *RebalanceState) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (RebalanceState) Validate

func (s RebalanceState) Validate() error

type RebalanceStatus

type RebalanceStatus struct {
	State RebalanceState `json:"state"`
	// Objects processed by the current or last run on this node.
	Objects int `json:"objects"`
	// Objects the run changed (fragments moved, sidecars rewritten, old copies retired).
	Relocated int `json:"relocated"`
	// Objects whose repair errored; the run continues past them.
	Failed int `json:"failed"`
	// Persisted resume cursor: everything up to and including (bucket, key) is done.
	CursorBucket OptString `json:"cursor_bucket"`
	CursorKey    OptString `json:"cursor_key"`
	// When the current or last run started on this node.
	StartedAt OptDateTime `json:"started_at"`
	// When the last run ended on this node.
	FinishedAt OptDateTime `json:"finished_at"`
	// Why the last run failed, for state "failed".
	ErrorMessage OptString `json:"error_message"`
	// Pending async replication-remainder tasks on this node (repair backlog indicator).
	RepairQueueDepth int `json:"repair_queue_depth"`
}

Ref: #/components/schemas/RebalanceStatus

func (*RebalanceStatus) Decode

func (s *RebalanceStatus) Decode(d *jx.Decoder) error

Decode decodes RebalanceStatus from json.

func (*RebalanceStatus) Encode

func (s *RebalanceStatus) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*RebalanceStatus) GetCursorBucket

func (s *RebalanceStatus) GetCursorBucket() OptString

GetCursorBucket returns the value of CursorBucket.

func (*RebalanceStatus) GetCursorKey

func (s *RebalanceStatus) GetCursorKey() OptString

GetCursorKey returns the value of CursorKey.

func (*RebalanceStatus) GetErrorMessage

func (s *RebalanceStatus) GetErrorMessage() OptString

GetErrorMessage returns the value of ErrorMessage.

func (*RebalanceStatus) GetFailed

func (s *RebalanceStatus) GetFailed() int

GetFailed returns the value of Failed.

func (*RebalanceStatus) GetFinishedAt

func (s *RebalanceStatus) GetFinishedAt() OptDateTime

GetFinishedAt returns the value of FinishedAt.

func (*RebalanceStatus) GetObjects

func (s *RebalanceStatus) GetObjects() int

GetObjects returns the value of Objects.

func (*RebalanceStatus) GetRelocated

func (s *RebalanceStatus) GetRelocated() int

GetRelocated returns the value of Relocated.

func (*RebalanceStatus) GetRepairQueueDepth

func (s *RebalanceStatus) GetRepairQueueDepth() int

GetRepairQueueDepth returns the value of RepairQueueDepth.

func (*RebalanceStatus) GetStartedAt

func (s *RebalanceStatus) GetStartedAt() OptDateTime

GetStartedAt returns the value of StartedAt.

func (*RebalanceStatus) GetState

func (s *RebalanceStatus) GetState() RebalanceState

GetState returns the value of State.

func (*RebalanceStatus) MarshalJSON

func (s *RebalanceStatus) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*RebalanceStatus) SetCursorBucket

func (s *RebalanceStatus) SetCursorBucket(val OptString)

SetCursorBucket sets the value of CursorBucket.

func (*RebalanceStatus) SetCursorKey

func (s *RebalanceStatus) SetCursorKey(val OptString)

SetCursorKey sets the value of CursorKey.

func (*RebalanceStatus) SetErrorMessage

func (s *RebalanceStatus) SetErrorMessage(val OptString)

SetErrorMessage sets the value of ErrorMessage.

func (*RebalanceStatus) SetFailed

func (s *RebalanceStatus) SetFailed(val int)

SetFailed sets the value of Failed.

func (*RebalanceStatus) SetFinishedAt

func (s *RebalanceStatus) SetFinishedAt(val OptDateTime)

SetFinishedAt sets the value of FinishedAt.

func (*RebalanceStatus) SetObjects

func (s *RebalanceStatus) SetObjects(val int)

SetObjects sets the value of Objects.

func (*RebalanceStatus) SetRelocated

func (s *RebalanceStatus) SetRelocated(val int)

SetRelocated sets the value of Relocated.

func (*RebalanceStatus) SetRepairQueueDepth

func (s *RebalanceStatus) SetRepairQueueDepth(val int)

SetRepairQueueDepth sets the value of RepairQueueDepth.

func (*RebalanceStatus) SetStartedAt

func (s *RebalanceStatus) SetStartedAt(val OptDateTime)

SetStartedAt sets the value of StartedAt.

func (*RebalanceStatus) SetState

func (s *RebalanceStatus) SetState(val RebalanceState)

SetState sets the value of State.

func (*RebalanceStatus) UnmarshalJSON

func (s *RebalanceStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*RebalanceStatus) Validate

func (s *RebalanceStatus) Validate() error

type ReloadResult

type ReloadResult struct {
	// What the reload applied: any of "credentials", "tls".
	Reloaded []string `json:"reloaded"`
	// The config revision in effect after the reload (see InstanceInfo.config_revision).
	ConfigRevision OptString `json:"config_revision"`
}

Ref: #/components/schemas/ReloadResult

func (*ReloadResult) Decode

func (s *ReloadResult) Decode(d *jx.Decoder) error

Decode decodes ReloadResult from json.

func (*ReloadResult) Encode

func (s *ReloadResult) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*ReloadResult) GetConfigRevision

func (s *ReloadResult) GetConfigRevision() OptString

GetConfigRevision returns the value of ConfigRevision.

func (*ReloadResult) GetReloaded

func (s *ReloadResult) GetReloaded() []string

GetReloaded returns the value of Reloaded.

func (*ReloadResult) MarshalJSON

func (s *ReloadResult) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ReloadResult) SetConfigRevision

func (s *ReloadResult) SetConfigRevision(val OptString)

SetConfigRevision sets the value of ConfigRevision.

func (*ReloadResult) SetReloaded

func (s *ReloadResult) SetReloaded(val []string)

SetReloaded sets the value of Reloaded.

func (*ReloadResult) UnmarshalJSON

func (s *ReloadResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ReloadResult) Validate

func (s *ReloadResult) Validate() error

type Route

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

Route is route object.

func (Route) Args

func (r Route) Args() []string

Args returns parsed arguments.

func (Route) Name

func (r Route) Name() string

Name returns ogen operation name.

It is guaranteed to be unique and not empty.

func (Route) OperationGroup

func (r Route) OperationGroup() string

OperationGroup returns the x-ogen-operation-group value.

func (Route) OperationID

func (r Route) OperationID() string

OperationID returns OpenAPI operationId.

func (Route) PathPattern

func (r Route) PathPattern() string

PathPattern returns OpenAPI path.

func (Route) Summary

func (r Route) Summary() string

Summary returns OpenAPI summary.

type Server

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

Server implements http server based on OpenAPI v3 specification and calls Handler to handle requests.

func NewServer

func NewServer(h Handler, opts ...ServerOption) (*Server, error)

NewServer creates new Server.

func (*Server) FindPath

func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool)

FindPath finds Route for given method and URL.

func (*Server) FindRoute

func (s *Server) FindRoute(method, path string) (Route, bool)

FindRoute finds Route for given method and path.

Note: this method does not unescape path or handle reserved characters in path properly. Use FindPath instead.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves http request as defined by OpenAPI v3 specification, calling handler that matches the path or returning not found error.

type ServerOption

type ServerOption interface {
	// contains filtered or unexported methods
}

ServerOption is server config option.

func WithErrorHandler

func WithErrorHandler(h ErrorHandler) ServerOption

WithErrorHandler specifies error handler to use.

func WithMaxMultipartMemory

func WithMaxMultipartMemory(max int64) ServerOption

WithMaxMultipartMemory specifies limit of memory for storing file parts. File parts which can't be stored in memory will be stored on disk in temporary files.

func WithMethodNotAllowed

func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption

WithMethodNotAllowed specifies Method Not Allowed handler to use.

func WithMiddleware

func WithMiddleware(m ...Middleware) ServerOption

WithMiddleware specifies middlewares to use.

func WithNotFound

func WithNotFound(notFound http.HandlerFunc) ServerOption

WithNotFound specifies Not Found handler to use.

func WithPathPrefix

func WithPathPrefix(prefix string) ServerOption

WithPathPrefix specifies server path prefix.

type SetBucketSchemeParams added in v0.7.0

type SetBucketSchemeParams struct {
	// The bucket name.
	Bucket string
}

SetBucketSchemeParams is parameters of setBucketScheme operation.

type SetBucketSchemeRequest added in v0.7.0

type SetBucketSchemeRequest struct {
	// The scheme override to apply, e.g. "rf3" or "ec:4,2". An empty string (or "default") clears the
	// override, restoring the cluster default.
	Scheme OptString `json:"scheme"`
}

Set or clear a bucket's replication-scheme override. Ref: #/components/schemas/SetBucketSchemeRequest

func (*SetBucketSchemeRequest) Decode added in v0.7.0

func (s *SetBucketSchemeRequest) Decode(d *jx.Decoder) error

Decode decodes SetBucketSchemeRequest from json.

func (*SetBucketSchemeRequest) Encode added in v0.7.0

func (s *SetBucketSchemeRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*SetBucketSchemeRequest) GetScheme added in v0.7.0

func (s *SetBucketSchemeRequest) GetScheme() OptString

GetScheme returns the value of Scheme.

func (*SetBucketSchemeRequest) MarshalJSON added in v0.7.0

func (s *SetBucketSchemeRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*SetBucketSchemeRequest) SetScheme added in v0.7.0

func (s *SetBucketSchemeRequest) SetScheme(val OptString)

SetScheme sets the value of Scheme.

func (*SetBucketSchemeRequest) UnmarshalJSON added in v0.7.0

func (s *SetBucketSchemeRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type SetPublicReadBucketsRequest added in v0.8.0

type SetPublicReadBucketsRequest struct {
	// The full new list; an empty array clears all public-read access.
	Buckets []string `json:"buckets"`
}

Replace the cluster-wide public-read bucket list. Ref: #/components/schemas/SetPublicReadBucketsRequest

func (*SetPublicReadBucketsRequest) Decode added in v0.8.0

Decode decodes SetPublicReadBucketsRequest from json.

func (*SetPublicReadBucketsRequest) Encode added in v0.8.0

func (s *SetPublicReadBucketsRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*SetPublicReadBucketsRequest) GetBuckets added in v0.8.0

func (s *SetPublicReadBucketsRequest) GetBuckets() []string

GetBuckets returns the value of Buckets.

func (*SetPublicReadBucketsRequest) MarshalJSON added in v0.8.0

func (s *SetPublicReadBucketsRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*SetPublicReadBucketsRequest) SetBuckets added in v0.8.0

func (s *SetPublicReadBucketsRequest) SetBuckets(val []string)

SetBuckets sets the value of Buckets.

func (*SetPublicReadBucketsRequest) UnmarshalJSON added in v0.8.0

func (s *SetPublicReadBucketsRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*SetPublicReadBucketsRequest) Validate added in v0.8.0

func (s *SetPublicReadBucketsRequest) Validate() error

type Source

type Source string

Where the credential is defined. Ref: #/components/schemas/Source

const (
	SourceConfig  Source = "config"
	SourceManaged Source = "managed"
)

func (Source) AllValues

func (Source) AllValues() []Source

AllValues returns all Source values.

func (*Source) Decode

func (s *Source) Decode(d *jx.Decoder) error

Decode decodes Source from json.

func (Source) Encode

func (s Source) Encode(e *jx.Encoder)

Encode encodes Source as json.

func (Source) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (Source) MarshalText

func (s Source) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*Source) UnmarshalJSON

func (s *Source) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Source) UnmarshalText

func (s *Source) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (Source) Validate

func (s Source) Validate() error

type UnimplementedHandler

type UnimplementedHandler struct{}

UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.

func (UnimplementedHandler) ControlRebalance

ControlRebalance implements controlRebalance operation.

Start, pause or resume the cluster-wide rebalance from this node. At most one rebalance runs cluster-wide (etcd election); starting on several nodes leaves the extras waiting as standby runners. Pausing stops this node's runner and keeps the resume cursor, so a later start/resume — on any node — continues where it left off.

POST /api/v1/cluster/rebalance

func (UnimplementedHandler) CreateAccessKey

CreateAccessKey implements createAccessKey operation.

Create a runtime credential. The access key and secret are generated when not supplied. The secret is returned only in this response and cannot be retrieved later.

POST /api/v1/access-keys

func (UnimplementedHandler) DeleteAccessKey

func (UnimplementedHandler) DeleteAccessKey(ctx context.Context, params DeleteAccessKeyParams) error

DeleteAccessKey implements deleteAccessKey operation.

Remove a runtime credential. Config-defined credentials cannot be deleted.

DELETE /api/v1/access-keys/{accessKey}

func (UnimplementedHandler) GetBucketScheme added in v0.7.0

func (UnimplementedHandler) GetBucketScheme(ctx context.Context, params GetBucketSchemeParams) (r *BucketScheme, _ error)

GetBucketScheme implements getBucketScheme operation.

The bucket's effective replication scheme, its explicit override (empty when the bucket follows the cluster default) and the cluster default. Returns 404 when the bucket does not exist and 501 when the server is not in cluster mode (a single-node server has no per-bucket schemes).

GET /api/v1/buckets/{bucket}/scheme

func (UnimplementedHandler) GetClusterStatus

func (UnimplementedHandler) GetClusterStatus(ctx context.Context) (r *ClusterStatus, _ error)

GetClusterStatus implements getClusterStatus operation.

Cluster-wide view read from the control plane: the agreed schema version, every node with its disks and reported capacity, aggregate capacity, placement skew and whether a rebalance is currently running. State is "disabled" when the server is not in cluster mode.

GET /api/v1/cluster/status

func (UnimplementedHandler) GetInfo

func (UnimplementedHandler) GetInfo(ctx context.Context) (r *InstanceInfo, _ error)

GetInfo implements getInfo operation.

Build information, uptime and whether authentication is enabled.

GET /api/v1/info

func (UnimplementedHandler) GetPublicReadBuckets added in v0.8.0

func (UnimplementedHandler) GetPublicReadBuckets(ctx context.Context) (r *PublicReadBuckets, _ error)

GetPublicReadBuckets implements getPublicReadBuckets operation.

Buckets readable anonymously (unsigned GET/HEAD/list), cluster-wide. Available only with cluster-wide credentials (auth.source: etcd); returns 501 otherwise, where public-read buckets are managed in the config file per node.

GET /api/v1/public-read-buckets

func (UnimplementedHandler) GetRebalanceStatus

func (UnimplementedHandler) GetRebalanceStatus(ctx context.Context) (r *RebalanceStatus, _ error)

GetRebalanceStatus implements getRebalanceStatus operation.

State and progress of the cluster rebalance runner on this node, the persisted resume cursor and the depth of the async repair queue. State is "disabled" when the server is not in cluster mode.

GET /api/v1/cluster/rebalance

func (UnimplementedHandler) ListAccessKeys

func (UnimplementedHandler) ListAccessKeys(ctx context.Context) (r *AccessKeyList, _ error)

ListAccessKeys implements listAccessKeys operation.

Every credential the server accepts, secrets omitted.

GET /api/v1/access-keys

func (UnimplementedHandler) NewError

func (UnimplementedHandler) NewError(ctx context.Context, err error) (r *ErrorStatusCode)

NewError creates *ErrorStatusCode from error returned by handler.

Used for common default response.

func (UnimplementedHandler) ReloadConfig

func (UnimplementedHandler) ReloadConfig(ctx context.Context) (r *ReloadResult, _ error)

ReloadConfig implements reloadConfig operation.

Re-read the configuration file and apply the parts that change without a restart — the config-defined credentials and grants, the anonymously readable buckets and the TLS certificate — exactly as SIGHUP does. Runtime credentials created through this API are preserved. Returns what was reloaded and the config revision now in effect, so an orchestrator can confirm a config change landed without shelling into the process. Returns 501 on a listener with nothing to reload (the headless cluster admin serves no S3 data).

POST /api/v1/reload

func (UnimplementedHandler) SetBucketScheme added in v0.7.0

SetBucketScheme implements setBucketScheme operation.

Override the bucket's replication scheme, or clear the override to restore the cluster default. The scheme must parse ("rf2.5", "rf3" or "ec:k,m") and the current topology must be able to host it. The change affects new writes cluster-wide within seconds; existing objects convert through repair/rebalance. Returns the effective scheme after applying. Returns 400 when the scheme is invalid or the topology cannot host it, 404 when the bucket does not exist and 501 when the server is not in cluster mode.

PUT /api/v1/buckets/{bucket}/scheme

func (UnimplementedHandler) SetPublicReadBuckets added in v0.8.0

SetPublicReadBuckets implements setPublicReadBuckets operation.

Replace the cluster-wide public-read bucket list. The change propagates to every node within seconds with no restart. Returns the stored list. Returns 400 on an invalid bucket name and 501 when not using cluster-wide credentials.

PUT /api/v1/public-read-buckets

Jump to

Keyboard shortcuts

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