master

package
v0.0.0-...-af53a4b Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Leader                 string `json:"leader"`
	MetricsIntervalSeconds uint32 `json:"metrics_interval_seconds"`
	VolumePreallocate      bool   `json:"volume_preallocate"`
	VolumeSizeLimitMB      uint32 `json:"volume_size_limit_m_b"`
}

Config represents Master server configuration attributes.

type Master

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

Master represents a connection to a SeaweedFS master server.

func New

func New(addr string) (*Master, error)

New creates a new API client for performing operations on a SeaweedFS master server with the provided address.

func (*Master) Addr

func (m *Master) Addr() url.URL

Addr returns the url.URL representing the HTTP/S address for the server that the Master API client is connected to.

func (*Master) Close

func (m *Master) Close() error

Close releases any resources used by the Master API client.

func (*Master) Config

func (m *Master) Config() (map[string]any, error)

Config returns the configuration attributes for the server the Master API client is connected to.

func (*Master) FindVolumes

func (m *Master) FindVolumes(ctx context.Context, collection string, fileID string) ([]url.URL, error)

FindVolumes returns the list of volume server URLs that have data associated with provided collection and file ID.

func (*Master) GRPCAddr

func (m *Master) GRPCAddr() string

GRPCAddr returns the gRPC target for the server that the Master API client is connected to.

func (*Master) ID

func (m *Master) ID() client.ID

ID returns the client.ID for the Master API client.

func (*Master) Name

func (m *Master) Name() string

Name returns the name for the Master API client.

func (*Master) PB

func (m *Master) PB() master_pb.SeaweedClient

PB returns the protobuf interface for the Master API client.

func (*Master) Ready

func (m *Master) Ready(ctx context.Context) (any, error)

Ready returns the master server configuration indicating that the API client has established a connection.

An error will be returned if the configuration could not be retrieved.

func (*Master) String

func (m *Master) String() string

String returns a string representation of the Master API client.

func (*Master) VolumeAddresses

func (m *Master) VolumeAddresses(ctx context.Context) ([]url.URL, error)

VolumeAddresses returns the list of all volume server addresses known by the Master server API client.

Jump to

Keyboard shortcuts

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