adminapi

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 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 BucketUsage added in v0.11.0

type BucketUsage struct {
	Bucket string `json:"bucket"`
	// How many objects the bucket holds.
	Objects int64 `json:"objects"`
	// What those objects occupy, summed over their sizes. This is logical size, not what the cluster
	// stores: replication and erasure coding multiply it on disk (see the scheme's overhead).
	Bytes int64 `json:"bytes"`
	// When an incremental change last moved these counters.
	Updated OptDateTime `json:"updated"`
	// When a full recount last anchored them. Absent means the totals have only ever been maintained
	// incrementally, so nothing has verified them against the objects themselves yet.
	Counted OptDateTime `json:"counted"`
}

One bucket's object count and total size. Ref: #/components/schemas/BucketUsage

func (*BucketUsage) Decode added in v0.11.0

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

Decode decodes BucketUsage from json.

func (*BucketUsage) Encode added in v0.11.0

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

Encode implements json.Marshaler.

func (*BucketUsage) GetBucket added in v0.11.0

func (s *BucketUsage) GetBucket() string

GetBucket returns the value of Bucket.

func (*BucketUsage) GetBytes added in v0.11.0

func (s *BucketUsage) GetBytes() int64

GetBytes returns the value of Bytes.

func (*BucketUsage) GetCounted added in v0.11.0

func (s *BucketUsage) GetCounted() OptDateTime

GetCounted returns the value of Counted.

func (*BucketUsage) GetObjects added in v0.11.0

func (s *BucketUsage) GetObjects() int64

GetObjects returns the value of Objects.

func (*BucketUsage) GetUpdated added in v0.11.0

func (s *BucketUsage) GetUpdated() OptDateTime

GetUpdated returns the value of Updated.

func (*BucketUsage) MarshalJSON added in v0.11.0

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

MarshalJSON implements stdjson.Marshaler.

func (*BucketUsage) SetBucket added in v0.11.0

func (s *BucketUsage) SetBucket(val string)

SetBucket sets the value of Bucket.

func (*BucketUsage) SetBytes added in v0.11.0

func (s *BucketUsage) SetBytes(val int64)

SetBytes sets the value of Bytes.

func (*BucketUsage) SetCounted added in v0.11.0

func (s *BucketUsage) SetCounted(val OptDateTime)

SetCounted sets the value of Counted.

func (*BucketUsage) SetObjects added in v0.11.0

func (s *BucketUsage) SetObjects(val int64)

SetObjects sets the value of Objects.

func (*BucketUsage) SetUpdated added in v0.11.0

func (s *BucketUsage) SetUpdated(val OptDateTime)

SetUpdated sets the value of Updated.

func (*BucketUsage) UnmarshalJSON added in v0.11.0

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

UnmarshalJSON implements stdjson.Unmarshaler.

type BucketUsageList added in v0.11.0

type BucketUsageList struct {
	// One entry per bucket that has been accounted for, sorted by name.
	Buckets []BucketUsage `json:"buckets"`
	// Objects across every bucket.
	Objects OptInt64 `json:"objects"`
	// Bytes across every bucket.
	Bytes OptInt64 `json:"bytes"`
}

Per-bucket object accounting, from the cluster's usage index. Ref: #/components/schemas/BucketUsageList

func (*BucketUsageList) Decode added in v0.11.0

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

Decode decodes BucketUsageList from json.

func (*BucketUsageList) Encode added in v0.11.0

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

Encode implements json.Marshaler.

func (*BucketUsageList) GetBuckets added in v0.11.0

func (s *BucketUsageList) GetBuckets() []BucketUsage

GetBuckets returns the value of Buckets.

func (*BucketUsageList) GetBytes added in v0.11.0

func (s *BucketUsageList) GetBytes() OptInt64

GetBytes returns the value of Bytes.

func (*BucketUsageList) GetObjects added in v0.11.0

func (s *BucketUsageList) GetObjects() OptInt64

GetObjects returns the value of Objects.

func (*BucketUsageList) MarshalJSON added in v0.11.0

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

MarshalJSON implements stdjson.Marshaler.

func (*BucketUsageList) SetBuckets added in v0.11.0

func (s *BucketUsageList) SetBuckets(val []BucketUsage)

SetBuckets sets the value of Buckets.

func (*BucketUsageList) SetBytes added in v0.11.0

func (s *BucketUsageList) SetBytes(val OptInt64)

SetBytes sets the value of Bytes.

func (*BucketUsageList) SetObjects added in v0.11.0

func (s *BucketUsageList) SetObjects(val OptInt64)

SetObjects sets the value of Objects.

func (*BucketUsageList) UnmarshalJSON added in v0.11.0

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*BucketUsageList) Validate added in v0.11.0

func (s *BucketUsageList) Validate() error

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) ApplyMigrations added in v0.9.0

func (c *Client) ApplyMigrations(ctx context.Context) (*MigrationStatus, error)

ApplyMigrations invokes applyMigrations operation.

Apply every pending migration in order, under the cluster-wide migrate election, and record the new schema version — the admin-API equivalent of `fs cluster migrate`. Run it once a rolling upgrade has replaced every node's binary; until then the cluster keeps operating at the old schema. Returns 409 when a migration is already running or when the cluster's schema is newer than this binary implements.

POST /api/v1/cluster/migrate

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) GetBucketUsage added in v0.11.0

func (c *Client) GetBucketUsage(ctx context.Context) (*BucketUsageList, error)

GetBucketUsage invokes getBucketUsage operation.

How many objects each bucket holds and how many bytes they occupy, read from the cluster's durable usage index rather than computed on demand — counting on demand would mean a scatter-gather over every disk, which is exactly what makes it unusable at the size where the question matters. The totals are maintained incrementally as objects are written and deleted, and re-derived from the objects themselves by a periodic cluster-wide recount. Between recounts a total can drift: a node that dies between committing a write and reporting it leaves its bucket short. Read `counted` to see when a total was last anchored, and `updated` for the last incremental change. Multipart uploads are counted only once completed; parts in flight are not objects and are not charged to the bucket. Returns 501 when the server is not in cluster mode.

GET /api/v1/buckets/usage

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) GetMigrationStatus added in v0.9.0

func (c *Client) GetMigrationStatus(ctx context.Context) (*MigrationStatus, error)

GetMigrationStatus invokes getMigrationStatus operation.

The schema version the cluster has agreed on, the version this binary implements, and the migrations still pending between them. State is "disabled" when the server is not in cluster mode.

GET /api/v1/cluster/migrate

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; not positive means drained (out of placement).
	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"`
	// Whether the disk still holds any fragment, as the node itself reports it. False means drained: its
	// data has been moved off and the volume can be deleted. Omitted when the node did not report live
	// state, or could not probe the disk (see data_error) — absent means unknown, never drained.
	// Capacity cannot answer this, since it comes from statfs: a disk holding no fragments still reports
	// bytes used.
	HasData OptBool `json:"has_data"`
	// Why the disk could not be probed; has_data is then absent.
	DataError OptString `json:"data_error"`
	// How many fragments the disk holds, from the node's occupancy index. Present only once that index has
	// been anchored by a scan — absent means "not counted yet", never "empty". This is drain progress,
	// not the drain verdict: has_data is what says the disk is safe to remove.
	Fragments OptInt64 `json:"fragments"`
	// What those fragments occupy, payload only — smaller than the used space implied by
	// total_bytes/free_bytes, which come from statfs and include filesystem overhead. Absent under the
	// same conditions as fragments.
	Bytes OptInt64 `json:"bytes"`
}

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) GetBytes added in v0.11.0

func (s *ClusterDisk) GetBytes() OptInt64

GetBytes returns the value of Bytes.

func (*ClusterDisk) GetDataError added in v0.10.0

func (s *ClusterDisk) GetDataError() OptString

GetDataError returns the value of DataError.

func (*ClusterDisk) GetFragments added in v0.11.0

func (s *ClusterDisk) GetFragments() OptInt64

GetFragments returns the value of Fragments.

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) GetHasData added in v0.10.0

func (s *ClusterDisk) GetHasData() OptBool

GetHasData returns the value of HasData.

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) SetBytes added in v0.11.0

func (s *ClusterDisk) SetBytes(val OptInt64)

SetBytes sets the value of Bytes.

func (*ClusterDisk) SetDataError added in v0.10.0

func (s *ClusterDisk) SetDataError(val OptString)

SetDataError sets the value of DataError.

func (*ClusterDisk) SetFragments added in v0.11.0

func (s *ClusterDisk) SetFragments(val OptInt64)

SetFragments sets the value of Fragments.

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) SetHasData added in v0.10.0

func (s *ClusterDisk) SetHasData(val OptBool)

SetHasData sets the value of HasData.

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"`
	Live  OptClusterNodeLive `json:"live"`
	// Why live state is missing for this node: unreachable, or running a binary that does not serve it.
	LiveError OptString `json:"live_error"`
}

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) GetLive added in v0.9.0

func (s *ClusterNode) GetLive() OptClusterNodeLive

GetLive returns the value of Live.

func (*ClusterNode) GetLiveError added in v0.9.0

func (s *ClusterNode) GetLiveError() OptString

GetLiveError returns the value of LiveError.

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) SetLive added in v0.9.0

func (s *ClusterNode) SetLive(val OptClusterNodeLive)

SetLive sets the value of Live.

func (*ClusterNode) SetLiveError added in v0.9.0

func (s *ClusterNode) SetLiveError(val OptString)

SetLiveError sets the value of LiveError.

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 ClusterNodeLive added in v0.9.0

type ClusterNodeLive struct {
	// The node's binary version — a half-upgraded cluster shows mixed values.
	Version OptString `json:"version"`
	// Schema version the node's binary implements.
	SchemaVersion OptInt     `json:"schema_version"`
	UptimeSeconds OptFloat64 `json:"uptime_seconds"`
	// Objects with pending async replication/repair work on the node.
	RepairQueueDepth   int            `json:"repair_queue_depth"`
	RebalanceState     RebalanceState `json:"rebalance_state"`
	RebalanceObjects   int            `json:"rebalance_objects"`
	RebalanceRelocated int            `json:"rebalance_relocated"`
	RebalanceFailed    int            `json:"rebalance_failed"`
	RebalanceError     OptString      `json:"rebalance_error"`
	ScrubPasses        int64          `json:"scrub_passes"`
	ScrubObjects       int64          `json:"scrub_objects"`
	ScrubRepaired      int64          `json:"scrub_repaired"`
	ScrubFailed        int64          `json:"scrub_failed"`
	// Fragments rebuilt by scrubs on the node (repair lag indicator).
	RebuiltFragments int64 `json:"rebuilt_fragments"`
	SweptStale       int64 `json:"swept_stale"`
	// Replica payloads that failed checksum verification (bit-rot).
	CorruptReplicas int64 `json:"corrupt_replicas"`
	// Objects rewritten to their bucket's current scheme.
	ConvertedObjects int64 `json:"converted_objects"`
	// The node's last scrub pass saw an EC set failing parity verification.
	EcUnverified bool `json:"ec_unverified"`
}

A node's live runtime state, fetched from the node itself over the peer transport — what only the running process knows, as opposed to the control-plane state in etcd. Ref: #/components/schemas/ClusterNodeLive

func (*ClusterNodeLive) Decode added in v0.9.0

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

Decode decodes ClusterNodeLive from json.

func (*ClusterNodeLive) Encode added in v0.9.0

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

Encode implements json.Marshaler.

func (*ClusterNodeLive) GetConvertedObjects added in v0.9.0

func (s *ClusterNodeLive) GetConvertedObjects() int64

GetConvertedObjects returns the value of ConvertedObjects.

func (*ClusterNodeLive) GetCorruptReplicas added in v0.9.0

func (s *ClusterNodeLive) GetCorruptReplicas() int64

GetCorruptReplicas returns the value of CorruptReplicas.

func (*ClusterNodeLive) GetEcUnverified added in v0.9.0

func (s *ClusterNodeLive) GetEcUnverified() bool

GetEcUnverified returns the value of EcUnverified.

func (*ClusterNodeLive) GetRebalanceError added in v0.9.0

func (s *ClusterNodeLive) GetRebalanceError() OptString

GetRebalanceError returns the value of RebalanceError.

func (*ClusterNodeLive) GetRebalanceFailed added in v0.9.0

func (s *ClusterNodeLive) GetRebalanceFailed() int

GetRebalanceFailed returns the value of RebalanceFailed.

func (*ClusterNodeLive) GetRebalanceObjects added in v0.9.0

func (s *ClusterNodeLive) GetRebalanceObjects() int

GetRebalanceObjects returns the value of RebalanceObjects.

func (*ClusterNodeLive) GetRebalanceRelocated added in v0.9.0

func (s *ClusterNodeLive) GetRebalanceRelocated() int

GetRebalanceRelocated returns the value of RebalanceRelocated.

func (*ClusterNodeLive) GetRebalanceState added in v0.9.0

func (s *ClusterNodeLive) GetRebalanceState() RebalanceState

GetRebalanceState returns the value of RebalanceState.

func (*ClusterNodeLive) GetRebuiltFragments added in v0.9.0

func (s *ClusterNodeLive) GetRebuiltFragments() int64

GetRebuiltFragments returns the value of RebuiltFragments.

func (*ClusterNodeLive) GetRepairQueueDepth added in v0.9.0

func (s *ClusterNodeLive) GetRepairQueueDepth() int

GetRepairQueueDepth returns the value of RepairQueueDepth.

func (*ClusterNodeLive) GetSchemaVersion added in v0.9.0

func (s *ClusterNodeLive) GetSchemaVersion() OptInt

GetSchemaVersion returns the value of SchemaVersion.

func (*ClusterNodeLive) GetScrubFailed added in v0.9.0

func (s *ClusterNodeLive) GetScrubFailed() int64

GetScrubFailed returns the value of ScrubFailed.

func (*ClusterNodeLive) GetScrubObjects added in v0.9.0

func (s *ClusterNodeLive) GetScrubObjects() int64

GetScrubObjects returns the value of ScrubObjects.

func (*ClusterNodeLive) GetScrubPasses added in v0.9.0

func (s *ClusterNodeLive) GetScrubPasses() int64

GetScrubPasses returns the value of ScrubPasses.

func (*ClusterNodeLive) GetScrubRepaired added in v0.9.0

func (s *ClusterNodeLive) GetScrubRepaired() int64

GetScrubRepaired returns the value of ScrubRepaired.

func (*ClusterNodeLive) GetSweptStale added in v0.9.0

func (s *ClusterNodeLive) GetSweptStale() int64

GetSweptStale returns the value of SweptStale.

func (*ClusterNodeLive) GetUptimeSeconds added in v0.9.0

func (s *ClusterNodeLive) GetUptimeSeconds() OptFloat64

GetUptimeSeconds returns the value of UptimeSeconds.

func (*ClusterNodeLive) GetVersion added in v0.9.0

func (s *ClusterNodeLive) GetVersion() OptString

GetVersion returns the value of Version.

func (*ClusterNodeLive) MarshalJSON added in v0.9.0

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

MarshalJSON implements stdjson.Marshaler.

func (*ClusterNodeLive) SetConvertedObjects added in v0.9.0

func (s *ClusterNodeLive) SetConvertedObjects(val int64)

SetConvertedObjects sets the value of ConvertedObjects.

func (*ClusterNodeLive) SetCorruptReplicas added in v0.9.0

func (s *ClusterNodeLive) SetCorruptReplicas(val int64)

SetCorruptReplicas sets the value of CorruptReplicas.

func (*ClusterNodeLive) SetEcUnverified added in v0.9.0

func (s *ClusterNodeLive) SetEcUnverified(val bool)

SetEcUnverified sets the value of EcUnverified.

func (*ClusterNodeLive) SetRebalanceError added in v0.9.0

func (s *ClusterNodeLive) SetRebalanceError(val OptString)

SetRebalanceError sets the value of RebalanceError.

func (*ClusterNodeLive) SetRebalanceFailed added in v0.9.0

func (s *ClusterNodeLive) SetRebalanceFailed(val int)

SetRebalanceFailed sets the value of RebalanceFailed.

func (*ClusterNodeLive) SetRebalanceObjects added in v0.9.0

func (s *ClusterNodeLive) SetRebalanceObjects(val int)

SetRebalanceObjects sets the value of RebalanceObjects.

func (*ClusterNodeLive) SetRebalanceRelocated added in v0.9.0

func (s *ClusterNodeLive) SetRebalanceRelocated(val int)

SetRebalanceRelocated sets the value of RebalanceRelocated.

func (*ClusterNodeLive) SetRebalanceState added in v0.9.0

func (s *ClusterNodeLive) SetRebalanceState(val RebalanceState)

SetRebalanceState sets the value of RebalanceState.

func (*ClusterNodeLive) SetRebuiltFragments added in v0.9.0

func (s *ClusterNodeLive) SetRebuiltFragments(val int64)

SetRebuiltFragments sets the value of RebuiltFragments.

func (*ClusterNodeLive) SetRepairQueueDepth added in v0.9.0

func (s *ClusterNodeLive) SetRepairQueueDepth(val int)

SetRepairQueueDepth sets the value of RepairQueueDepth.

func (*ClusterNodeLive) SetSchemaVersion added in v0.9.0

func (s *ClusterNodeLive) SetSchemaVersion(val OptInt)

SetSchemaVersion sets the value of SchemaVersion.

func (*ClusterNodeLive) SetScrubFailed added in v0.9.0

func (s *ClusterNodeLive) SetScrubFailed(val int64)

SetScrubFailed sets the value of ScrubFailed.

func (*ClusterNodeLive) SetScrubObjects added in v0.9.0

func (s *ClusterNodeLive) SetScrubObjects(val int64)

SetScrubObjects sets the value of ScrubObjects.

func (*ClusterNodeLive) SetScrubPasses added in v0.9.0

func (s *ClusterNodeLive) SetScrubPasses(val int64)

SetScrubPasses sets the value of ScrubPasses.

func (*ClusterNodeLive) SetScrubRepaired added in v0.9.0

func (s *ClusterNodeLive) SetScrubRepaired(val int64)

SetScrubRepaired sets the value of ScrubRepaired.

func (*ClusterNodeLive) SetSweptStale added in v0.9.0

func (s *ClusterNodeLive) SetSweptStale(val int64)

SetSweptStale sets the value of SweptStale.

func (*ClusterNodeLive) SetUptimeSeconds added in v0.9.0

func (s *ClusterNodeLive) SetUptimeSeconds(val OptFloat64)

SetUptimeSeconds sets the value of UptimeSeconds.

func (*ClusterNodeLive) SetVersion added in v0.9.0

func (s *ClusterNodeLive) SetVersion(val OptString)

SetVersion sets the value of Version.

func (*ClusterNodeLive) UnmarshalJSON added in v0.9.0

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ClusterNodeLive) Validate added in v0.9.0

func (s *ClusterNodeLive) 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"`
	// Pending async replication/repair work summed over the nodes that reported live state.
	RepairQueueDepth int `json:"repair_queue_depth"`
	// Nodes that answered the live-state request.
	NodesReporting int `json:"nodes_reporting"`
	// Nodes that did not answer: unreachable, or running a binary that does not serve live state.
	NodesNotReporting int           `json:"nodes_not_reporting"`
	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) GetNodesNotReporting added in v0.9.0

func (s *ClusterStatus) GetNodesNotReporting() int

GetNodesNotReporting returns the value of NodesNotReporting.

func (*ClusterStatus) GetNodesReporting added in v0.9.0

func (s *ClusterStatus) GetNodesReporting() int

GetNodesReporting returns the value of NodesReporting.

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) GetRepairQueueDepth added in v0.9.0

func (s *ClusterStatus) GetRepairQueueDepth() int

GetRepairQueueDepth returns the value of RepairQueueDepth.

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) SetNodesNotReporting added in v0.9.0

func (s *ClusterStatus) SetNodesNotReporting(val int)

SetNodesNotReporting sets the value of NodesNotReporting.

func (*ClusterStatus) SetNodesReporting added in v0.9.0

func (s *ClusterStatus) SetNodesReporting(val int)

SetNodesReporting sets the value of NodesReporting.

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) SetRepairQueueDepth added in v0.9.0

func (s *ClusterStatus) SetRepairQueueDepth(val int)

SetRepairQueueDepth sets the value of RepairQueueDepth.

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 {
	// ApplyMigrations implements applyMigrations operation.
	//
	// Apply every pending migration in order, under the cluster-wide migrate election, and record the new
	// schema version — the admin-API equivalent of `fs cluster migrate`. Run it once a rolling upgrade
	// has replaced every node's binary; until then the cluster keeps operating at the old schema. Returns
	// 409 when a migration is already running or when the cluster's schema is newer than this binary
	// implements.
	//
	// POST /api/v1/cluster/migrate
	ApplyMigrations(ctx context.Context) (*MigrationStatus, error)
	// 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)
	// GetBucketUsage implements getBucketUsage operation.
	//
	// How many objects each bucket holds and how many bytes they occupy, read from the cluster's durable
	// usage index rather than computed on demand — counting on demand would mean a scatter-gather over
	// every disk, which is exactly what makes it unusable at the size where the question matters. The
	// totals are maintained incrementally as objects are written and deleted, and re-derived from the
	// objects themselves by a periodic cluster-wide recount. Between recounts a total can drift: a node
	// that dies between committing a write and reporting it leaves its bucket short. Read `counted` to see
	// when a total was last anchored, and `updated` for the last incremental change. Multipart uploads are
	// counted only once completed; parts in flight are not objects and are not charged to the bucket.
	// Returns 501 when the server is not in cluster mode.
	//
	// GET /api/v1/buckets/usage
	GetBucketUsage(ctx context.Context) (*BucketUsageList, 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)
	// GetMigrationStatus implements getMigrationStatus operation.
	//
	// The schema version the cluster has agreed on, the version this binary implements, and the migrations
	// still pending between them. State is "disabled" when the server is not in cluster mode.
	//
	// GET /api/v1/cluster/migrate
	GetMigrationStatus(ctx context.Context) (*MigrationStatus, 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 {
	// ApplyMigrations invokes applyMigrations operation.
	//
	// Apply every pending migration in order, under the cluster-wide migrate election, and record the new
	// schema version — the admin-API equivalent of `fs cluster migrate`. Run it once a rolling upgrade
	// has replaced every node's binary; until then the cluster keeps operating at the old schema. Returns
	// 409 when a migration is already running or when the cluster's schema is newer than this binary
	// implements.
	//
	// POST /api/v1/cluster/migrate
	ApplyMigrations(ctx context.Context) (*MigrationStatus, 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
	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)
	// GetBucketUsage invokes getBucketUsage operation.
	//
	// How many objects each bucket holds and how many bytes they occupy, read from the cluster's durable
	// usage index rather than computed on demand — counting on demand would mean a scatter-gather over
	// every disk, which is exactly what makes it unusable at the size where the question matters. The
	// totals are maintained incrementally as objects are written and deleted, and re-derived from the
	// objects themselves by a periodic cluster-wide recount. Between recounts a total can drift: a node
	// that dies between committing a write and reporting it leaves its bucket short. Read `counted` to see
	// when a total was last anchored, and `updated` for the last incremental change. Multipart uploads are
	// counted only once completed; parts in flight are not objects and are not charged to the bucket.
	// Returns 501 when the server is not in cluster mode.
	//
	// GET /api/v1/buckets/usage
	GetBucketUsage(ctx context.Context) (*BucketUsageList, 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)
	// GetMigrationStatus invokes getMigrationStatus operation.
	//
	// The schema version the cluster has agreed on, the version this binary implements, and the migrations
	// still pending between them. State is "disabled" when the server is not in cluster mode.
	//
	// GET /api/v1/cluster/migrate
	GetMigrationStatus(ctx context.Context) (*MigrationStatus, 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 Migration added in v0.9.0

type Migration struct {
	// Schema version this migration produces.
	Version     int    `json:"version"`
	Description string `json:"description"`
}

A pending schema migration. Ref: #/components/schemas/Migration

func (*Migration) Decode added in v0.9.0

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

Decode decodes Migration from json.

func (*Migration) Encode added in v0.9.0

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

Encode implements json.Marshaler.

func (*Migration) GetDescription added in v0.9.0

func (s *Migration) GetDescription() string

GetDescription returns the value of Description.

func (*Migration) GetVersion added in v0.9.0

func (s *Migration) GetVersion() int

GetVersion returns the value of Version.

func (*Migration) MarshalJSON added in v0.9.0

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

MarshalJSON implements stdjson.Marshaler.

func (*Migration) SetDescription added in v0.9.0

func (s *Migration) SetDescription(val string)

SetDescription sets the value of Description.

func (*Migration) SetVersion added in v0.9.0

func (s *Migration) SetVersion(val int)

SetVersion sets the value of Version.

func (*Migration) UnmarshalJSON added in v0.9.0

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

UnmarshalJSON implements stdjson.Unmarshaler.

type MigrationStatus added in v0.9.0

type MigrationStatus struct {
	State ClusterState `json:"state"`
	// Schema version the cluster has agreed on; 0 when none is recorded yet (no node has joined).
	ClusterSchemaVersion int `json:"cluster_schema_version"`
	// Schema version this binary implements.
	BinarySchemaVersion int `json:"binary_schema_version"`
	// True when nothing is pending: the cluster is at the binary's schema version.
	UpToDate bool `json:"up_to_date"`
	// True while this process is applying migrations.
	Running bool        `json:"running"`
	Pending []Migration `json:"pending"`
	// Versions applied by the most recent run on this process.
	LastApplied []int `json:"last_applied"`
	// Why the most recent run on this process failed.
	LastError OptString `json:"last_error"`
}

Cluster schema state and the migrations pending between cluster and binary. Ref: #/components/schemas/MigrationStatus

func (*MigrationStatus) Decode added in v0.9.0

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

Decode decodes MigrationStatus from json.

func (*MigrationStatus) Encode added in v0.9.0

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

Encode implements json.Marshaler.

func (*MigrationStatus) GetBinarySchemaVersion added in v0.9.0

func (s *MigrationStatus) GetBinarySchemaVersion() int

GetBinarySchemaVersion returns the value of BinarySchemaVersion.

func (*MigrationStatus) GetClusterSchemaVersion added in v0.9.0

func (s *MigrationStatus) GetClusterSchemaVersion() int

GetClusterSchemaVersion returns the value of ClusterSchemaVersion.

func (*MigrationStatus) GetLastApplied added in v0.9.0

func (s *MigrationStatus) GetLastApplied() []int

GetLastApplied returns the value of LastApplied.

func (*MigrationStatus) GetLastError added in v0.9.0

func (s *MigrationStatus) GetLastError() OptString

GetLastError returns the value of LastError.

func (*MigrationStatus) GetPending added in v0.9.0

func (s *MigrationStatus) GetPending() []Migration

GetPending returns the value of Pending.

func (*MigrationStatus) GetRunning added in v0.9.0

func (s *MigrationStatus) GetRunning() bool

GetRunning returns the value of Running.

func (*MigrationStatus) GetState added in v0.9.0

func (s *MigrationStatus) GetState() ClusterState

GetState returns the value of State.

func (*MigrationStatus) GetUpToDate added in v0.9.0

func (s *MigrationStatus) GetUpToDate() bool

GetUpToDate returns the value of UpToDate.

func (*MigrationStatus) MarshalJSON added in v0.9.0

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

MarshalJSON implements stdjson.Marshaler.

func (*MigrationStatus) SetBinarySchemaVersion added in v0.9.0

func (s *MigrationStatus) SetBinarySchemaVersion(val int)

SetBinarySchemaVersion sets the value of BinarySchemaVersion.

func (*MigrationStatus) SetClusterSchemaVersion added in v0.9.0

func (s *MigrationStatus) SetClusterSchemaVersion(val int)

SetClusterSchemaVersion sets the value of ClusterSchemaVersion.

func (*MigrationStatus) SetLastApplied added in v0.9.0

func (s *MigrationStatus) SetLastApplied(val []int)

SetLastApplied sets the value of LastApplied.

func (*MigrationStatus) SetLastError added in v0.9.0

func (s *MigrationStatus) SetLastError(val OptString)

SetLastError sets the value of LastError.

func (*MigrationStatus) SetPending added in v0.9.0

func (s *MigrationStatus) SetPending(val []Migration)

SetPending sets the value of Pending.

func (*MigrationStatus) SetRunning added in v0.9.0

func (s *MigrationStatus) SetRunning(val bool)

SetRunning sets the value of Running.

func (*MigrationStatus) SetState added in v0.9.0

func (s *MigrationStatus) SetState(val ClusterState)

SetState sets the value of State.

func (*MigrationStatus) SetUpToDate added in v0.9.0

func (s *MigrationStatus) SetUpToDate(val bool)

SetUpToDate sets the value of UpToDate.

func (*MigrationStatus) UnmarshalJSON added in v0.9.0

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*MigrationStatus) Validate added in v0.9.0

func (s *MigrationStatus) Validate() error

type OperationName

type OperationName = string

OperationName is the ogen operation name

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

type OptBool added in v0.10.0

type OptBool struct {
	Value bool
	Set   bool
}

OptBool is optional bool.

func NewOptBool added in v0.10.0

func NewOptBool(v bool) OptBool

NewOptBool returns new OptBool with value set to v.

func (*OptBool) Decode added in v0.10.0

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

Decode decodes bool from json.

func (OptBool) Encode added in v0.10.0

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

Encode encodes bool as json.

func (OptBool) Get added in v0.10.0

func (o OptBool) Get() (v bool, ok bool)

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

func (OptBool) IsSet added in v0.10.0

func (o OptBool) IsSet() bool

IsSet returns true if OptBool was set.

func (OptBool) MarshalJSON added in v0.10.0

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

MarshalJSON implements stdjson.Marshaler.

func (OptBool) Or added in v0.10.0

func (o OptBool) Or(d bool) bool

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

func (*OptBool) Reset added in v0.10.0

func (o *OptBool) Reset()

Reset unsets value.

func (*OptBool) SetTo added in v0.10.0

func (o *OptBool) SetTo(v bool)

SetTo sets value to v.

func (*OptBool) UnmarshalJSON added in v0.10.0

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptClusterNodeLive added in v0.9.0

type OptClusterNodeLive struct {
	Value ClusterNodeLive
	Set   bool
}

OptClusterNodeLive is optional ClusterNodeLive.

func NewOptClusterNodeLive added in v0.9.0

func NewOptClusterNodeLive(v ClusterNodeLive) OptClusterNodeLive

NewOptClusterNodeLive returns new OptClusterNodeLive with value set to v.

func (*OptClusterNodeLive) Decode added in v0.9.0

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

Decode decodes ClusterNodeLive from json.

func (OptClusterNodeLive) Encode added in v0.9.0

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

Encode encodes ClusterNodeLive as json.

func (OptClusterNodeLive) Get added in v0.9.0

func (o OptClusterNodeLive) Get() (v ClusterNodeLive, ok bool)

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

func (OptClusterNodeLive) IsSet added in v0.9.0

func (o OptClusterNodeLive) IsSet() bool

IsSet returns true if OptClusterNodeLive was set.

func (OptClusterNodeLive) MarshalJSON added in v0.9.0

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

MarshalJSON implements stdjson.Marshaler.

func (OptClusterNodeLive) Or added in v0.9.0

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

func (*OptClusterNodeLive) Reset added in v0.9.0

func (o *OptClusterNodeLive) Reset()

Reset unsets value.

func (*OptClusterNodeLive) SetTo added in v0.9.0

func (o *OptClusterNodeLive) SetTo(v ClusterNodeLive)

SetTo sets value to v.

func (*OptClusterNodeLive) UnmarshalJSON added in v0.9.0

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

UnmarshalJSON implements stdjson.Unmarshaler.

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 OptInt added in v0.9.0

type OptInt struct {
	Value int
	Set   bool
}

OptInt is optional int.

func NewOptInt added in v0.9.0

func NewOptInt(v int) OptInt

NewOptInt returns new OptInt with value set to v.

func (*OptInt) Decode added in v0.9.0

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

Decode decodes int from json.

func (OptInt) Encode added in v0.9.0

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

Encode encodes int as json.

func (OptInt) Get added in v0.9.0

func (o OptInt) Get() (v int, ok bool)

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

func (OptInt) IsSet added in v0.9.0

func (o OptInt) IsSet() bool

IsSet returns true if OptInt was set.

func (OptInt) MarshalJSON added in v0.9.0

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

MarshalJSON implements stdjson.Marshaler.

func (OptInt) Or added in v0.9.0

func (o OptInt) Or(d int) int

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

func (*OptInt) Reset added in v0.9.0

func (o *OptInt) Reset()

Reset unsets value.

func (*OptInt) SetTo added in v0.9.0

func (o *OptInt) SetTo(v int)

SetTo sets value to v.

func (*OptInt) UnmarshalJSON added in v0.9.0

func (s *OptInt) 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) ApplyMigrations added in v0.9.0

func (UnimplementedHandler) ApplyMigrations(ctx context.Context) (r *MigrationStatus, _ error)

ApplyMigrations implements applyMigrations operation.

Apply every pending migration in order, under the cluster-wide migrate election, and record the new schema version — the admin-API equivalent of `fs cluster migrate`. Run it once a rolling upgrade has replaced every node's binary; until then the cluster keeps operating at the old schema. Returns 409 when a migration is already running or when the cluster's schema is newer than this binary implements.

POST /api/v1/cluster/migrate

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) GetBucketUsage added in v0.11.0

func (UnimplementedHandler) GetBucketUsage(ctx context.Context) (r *BucketUsageList, _ error)

GetBucketUsage implements getBucketUsage operation.

How many objects each bucket holds and how many bytes they occupy, read from the cluster's durable usage index rather than computed on demand — counting on demand would mean a scatter-gather over every disk, which is exactly what makes it unusable at the size where the question matters. The totals are maintained incrementally as objects are written and deleted, and re-derived from the objects themselves by a periodic cluster-wide recount. Between recounts a total can drift: a node that dies between committing a write and reporting it leaves its bucket short. Read `counted` to see when a total was last anchored, and `updated` for the last incremental change. Multipart uploads are counted only once completed; parts in flight are not objects and are not charged to the bucket. Returns 501 when the server is not in cluster mode.

GET /api/v1/buckets/usage

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) GetMigrationStatus added in v0.9.0

func (UnimplementedHandler) GetMigrationStatus(ctx context.Context) (r *MigrationStatus, _ error)

GetMigrationStatus implements getMigrationStatus operation.

The schema version the cluster has agreed on, the version this binary implements, and the migrations still pending between them. State is "disabled" when the server is not in cluster mode.

GET /api/v1/cluster/migrate

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