bucket_json

package
v0.53.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyBucketConfigResult

type ApplyBucketConfigResult struct {
	// BucketId is the bucket ID.
	BucketId string `json:"bucket_id,omitempty"`
	// VolumeId is the volume ID.
	VolumeId string `json:"volume_id,omitempty"`
	// Error is the error.
	Error string `json:"error,omitempty"`
	// BucketConf is the curr bucket conf.
	BucketConf *Config `json:"bucket_conf,omitempty"`
	// OldBucketConf is the old bucket conf.
	OldBucketConf *Config `json:"old_bucket_conf,omitempty"`
	// Timestamp is the timestamp.
	Timestamp time.Time `json:"timestamp"`
	// Updated indicates if the value was updated.
	Updated bool `json:"updated"`
}

ApplyBucketConfigResult is the JSON marshaler for the response.

func NewApplyBucketConfigResult

func NewApplyBucketConfigResult(
	ctx context.Context,
	b bus.Bus,
	obj *bucket.ApplyBucketConfigResult,
) (*ApplyBucketConfigResult, error)

NewApplyBucketConfigResult builds a new put bucket config response.

func (*ApplyBucketConfigResult) MarshalJSON

func (c *ApplyBucketConfigResult) MarshalJSON() ([]byte, error)

MarshalJSON marshals the result to JSON.

type Config

type Config struct {
	// Id is the bucket identifier.
	Id string `json:"id"`
	// Rev is the configuration version.
	Rev uint32 `json:"version"`
	// PutOpts contains the put options.
	PutOpts *block.PutOpts `json:"putOpts,omitempty"`
	// Lookup controls the lookup confiuration.
	Lookup *LookupConfig `json:"lookup,omitempty"`
}

Config implements the bucket configuration JSON marshalling logic.

func NewConfig

func NewConfig(ctx context.Context, b bus.Bus, c *bucket.Config) (*Config, error)

NewConfig builds a new controller config.

func ParseConfig

func ParseConfig(dat []byte) (*Config, error)

ParseConfig parses the bucket config JSON bytes.

func (*Config) GetRev

func (c *Config) GetRev() uint32

GetRev returns the version.

func (*Config) MarshalJSON

func (c *Config) MarshalJSON() ([]byte, error)

MarshalJSON marshals the config to JSON.

func (*Config) ResolveToProto

func (c *Config) ResolveToProto(ctx context.Context, b bus.Bus) (*bucket.Config, error)

ResolveToProto resolves the config to a proto object.

type LookupConfig

type LookupConfig struct {
	// Disble indicates we should not service cross-volume calls against this
	// bucket.
	Disable bool `json:"disable"`
	// Controller is the controller configuration.
	Controller *configset_json.ControllerConfig `json:"controller"`
}

LookupConfig implements the lookup configuration JSON marshalling logic.

func NewLookupConfig

func NewLookupConfig(disable bool, config configset.ControllerConfig) *LookupConfig

NewLookupConfig builds a new lookup config.

func (*LookupConfig) GetDisable

func (c *LookupConfig) GetDisable() bool

GetDisable returns the disable field.

type PutOpts

type PutOpts struct {
	// Id is the reconciler ID.
	Id string `json:"id"`
	// Controller is the controller configuration.
	Controller *configset_json.ControllerConfig `json:"controller"`
}

PutOpts implements the put options JSON marshalling logic.

func NewPutOpts

func NewPutOpts(id string, config configset.ControllerConfig) *PutOpts

NewPutOpts builds a new controller config.

func (*PutOpts) GetId

func (c *PutOpts) GetId() string

GetId returns the id.

Jump to

Keyboard shortcuts

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