wdclient

package
v0.0.0-...-45e1a9a Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HasLookupFileIdFunction

type HasLookupFileIdFunction interface {
	GetLookupFileIdFunction() LookupFileIdFunctionType
}

type Location

type Location struct {
	Url        string `json:"url,omitempty"`
	PublicUrl  string `json:"publicUrl,omitempty"`
	DataCenter string `json:"dataCenter,omitempty"`
	GrpcPort   int    `json:"grpcPort,omitempty"`
}

func (Location) ServerAddress

func (l Location) ServerAddress() pb.ServerAddress

type LookupFileIdFunctionType

type LookupFileIdFunctionType func(fileId string) (targetUrls []string, err error)

type MasterClient

type MasterClient struct {
	FilerGroup string

	OnPeerUpdate     func(update *master_pb.ClusterNodeUpdate, startFrom time.Time)
	OnPeerUpdateLock sync.RWMutex
	// contains filtered or unexported fields
}

func NewMasterClient

func NewMasterClient(grpcDialOption grpc.DialOption, filerGroup string, clientType string, clientHost pb.ServerAddress, clientDataCenter string, rack string, masters pb.ServerDiscovery) *MasterClient

func (*MasterClient) FindLeaderFromOtherPeers

func (mc *MasterClient) FindLeaderFromOtherPeers(myMasterAddress pb.ServerAddress) (leader string)

func (MasterClient) GetLocations

func (vc MasterClient) GetLocations(vid uint32) (locations []Location, found bool)

func (MasterClient) GetLocationsClone

func (vc MasterClient) GetLocationsClone(vid uint32) (locations []Location, found bool)

func (*MasterClient) GetLookupFileIdFunction

func (mc *MasterClient) GetLookupFileIdFunction() LookupFileIdFunctionType

func (*MasterClient) GetMaster

func (mc *MasterClient) GetMaster(ctx context.Context) pb.ServerAddress

func (*MasterClient) GetMasters

func (mc *MasterClient) GetMasters(ctx context.Context) []pb.ServerAddress

func (MasterClient) GetVidLocations

func (vc MasterClient) GetVidLocations(vid string) (locations []Location, err error)

func (*MasterClient) KeepConnectedToMaster

func (mc *MasterClient) KeepConnectedToMaster(ctx context.Context)

func (MasterClient) LookupFileId

func (vc MasterClient) LookupFileId(fileId string) (fullUrls []string, err error)

func (*MasterClient) LookupFileIdWithFallback

func (mc *MasterClient) LookupFileIdWithFallback(fileId string) (fullUrls []string, err error)

func (MasterClient) LookupVolumeServerUrl

func (vc MasterClient) LookupVolumeServerUrl(vid string) (serverUrls []string, err error)

func (*MasterClient) SetOnPeerUpdateFn

func (mc *MasterClient) SetOnPeerUpdateFn(onPeerUpdate func(update *master_pb.ClusterNodeUpdate, startFrom time.Time))

func (*MasterClient) WaitUntilConnected

func (mc *MasterClient) WaitUntilConnected(ctx context.Context)

func (*MasterClient) WithClient

func (mc *MasterClient) WithClient(streamingMode bool, fn func(client master_pb.SeaweedClient) error) error

func (*MasterClient) WithClientCustomGetMaster

func (mc *MasterClient) WithClientCustomGetMaster(getMasterF func() pb.ServerAddress, streamingMode bool, fn func(client master_pb.SeaweedClient) error) error

Directories

Path Synopsis
net2 is a collection of functions meant to supplement the capabilities provided by the standard "net" package.
net2 is a collection of functions meant to supplement the capabilities provided by the standard "net" package.
A generic resource pool for managing resources such as network connections.
A generic resource pool for managing resources such as network connections.

Jump to

Keyboard shortcuts

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