pb

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: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AdminShellClient = "adminShell"
)
View Source
const (
	Max_Message_Size = 1 << 30 // 1 GB
)

Variables

This section is empty.

Functions

func FollowMetadata

func FollowMetadata(filerAddress ServerAddress, grpcDialOption grpc.DialOption, option *MetadataFollowOption, processEventFn ProcessMetadataFunc) error

func GrpcAddressToServerAddress

func GrpcAddressToServerAddress(grpcAddress string) (serverAddress string)

func GrpcDial

func GrpcDial(ctx context.Context, address string, waitForReady bool, opts ...grpc.DialOption) (*grpc.ClientConn, error)

func NewGrpcServer

func NewGrpcServer(opts ...grpc.ServerOption) *grpc.Server

func ParseServerAddress

func ParseServerAddress(server string, deltaPort int) (newServerAddress string, err error)

func ServerToGrpcAddress

func ServerToGrpcAddress(server string) (serverGrpcAddress string)

func ToAddressStrings

func ToAddressStrings(addresses []ServerAddress) []string

func ToAddressStringsFromMap

func ToAddressStringsFromMap(addresses map[string]ServerAddress) []string

func WithBrokerGrpcClient

func WithBrokerGrpcClient(streamingMode bool, brokerGrpcAddress string, grpcDialOption grpc.DialOption, fn func(client mq_pb.SeaweedMessagingClient) error) error

func WithFilerClient

func WithFilerClient(streamingMode bool, signature int32, filer ServerAddress, grpcDialOption grpc.DialOption, fn func(client filer_pb.SeaweedFilerClient) error) error

func WithFilerClientFollowMetadata

func WithFilerClientFollowMetadata(filerClient filer_pb.FilerClient, option *MetadataFollowOption, processEventFn ProcessMetadataFunc) error

func WithGrpcClient

func WithGrpcClient(streamingMode bool, signature int32, fn func(*grpc.ClientConn) error, address string, waitForReady bool, opts ...grpc.DialOption) error

WithGrpcClient In streamingMode, always use a fresh connection. Otherwise, try to reuse an existing connection.

func WithGrpcFilerClient

func WithGrpcFilerClient(streamingMode bool, signature int32, filerGrpcAddress ServerAddress, grpcDialOption grpc.DialOption, fn func(client filer_pb.SeaweedFilerClient) error) error

func WithMasterClient

func WithMasterClient(streamingMode bool, master ServerAddress, grpcDialOption grpc.DialOption, waitForReady bool, fn func(client master_pb.SeaweedClient) error) error

func WithOneOfGrpcFilerClients

func WithOneOfGrpcFilerClients(streamingMode bool, filerAddresses []ServerAddress, grpcDialOption grpc.DialOption, fn func(client filer_pb.SeaweedFilerClient) error) (err error)

func WithOneOfGrpcMasterClients

func WithOneOfGrpcMasterClients(streamingMode bool, masterGrpcAddresses map[string]ServerAddress, grpcDialOption grpc.DialOption, fn func(client master_pb.SeaweedClient) error) (err error)

func WithVolumeServerClient

func WithVolumeServerClient(streamingMode bool, volumeServer ServerAddress, grpcDialOption grpc.DialOption, fn func(client volume_server_pb.VolumeServerClient) error) error

Types

type EventErrorType

type EventErrorType int
const (
	TrivialOnError EventErrorType = iota
	FatalOnError
	RetryForeverOnError
	DontLogError
)

type MetadataFollowOption

type MetadataFollowOption struct {
	ClientName             string
	ClientId               int32
	ClientEpoch            int32
	SelfSignature          int32
	PathPrefix             string
	AdditionalPathPrefixes []string
	DirectoriesToWatch     []string
	StartTsNs              int64
	StopTsNs               int64
	EventErrorType         EventErrorType
}

MetadataFollowOption is used to control the behavior of the metadata following process. Part of it is used as a cursor to resume the following process.

type ProcessMetadataFunc

type ProcessMetadataFunc func(resp *filer_pb.SubscribeMetadataResponse) error

func AddOffsetFunc

func AddOffsetFunc(processEventFn ProcessMetadataFunc, offsetInterval time.Duration, offsetFunc func(counter int64, offset int64) error) ProcessMetadataFunc

type ServerAddress

type ServerAddress string

func FromAddressStrings

func FromAddressStrings(strings []string) []ServerAddress

func NewServerAddress

func NewServerAddress(host string, port int, grpcPort int) ServerAddress

func NewServerAddressFromDataNode

func NewServerAddressFromDataNode(dn *master_pb.DataNodeInfo) ServerAddress

func NewServerAddressFromLocation

func NewServerAddressFromLocation(dn *master_pb.Location) ServerAddress

func NewServerAddressWithGrpcPort

func NewServerAddressWithGrpcPort(address string, grpcPort int) ServerAddress

func ParseUrl

func ParseUrl(input string) (address ServerAddress, path string, err error)

func (ServerAddress) String

func (sa ServerAddress) String() string

func (ServerAddress) ToGrpcAddress

func (sa ServerAddress) ToGrpcAddress() string

func (ServerAddress) ToHttpAddress

func (sa ServerAddress) ToHttpAddress() string

type ServerAddresses

type ServerAddresses string

func (ServerAddresses) ToAddressMap

func (sa ServerAddresses) ToAddressMap() (addresses map[string]ServerAddress)

func (ServerAddresses) ToAddressStrings

func (sa ServerAddresses) ToAddressStrings() (addresses []string)

func (ServerAddresses) ToAddresses

func (sa ServerAddresses) ToAddresses() (addresses []ServerAddress)

func (ServerAddresses) ToServiceDiscovery

func (sa ServerAddresses) ToServiceDiscovery() (sd *ServerDiscovery)

ToServiceDiscovery expects one of: a comma-separated list of ip:port, like

10.0.0.1:9999,10.0.0.2:24:9999

OR an SRV Record prepended with 'dnssrv+', like:

dnssrv+_grpc._tcp.master.consul
dnssrv+_grpc._tcp.headless.default.svc.cluster.local
dnssrv+seaweed-master.master.consul

type ServerDiscovery

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

ServerDiscovery encodes a way to find at least 1 instance of a service, and provides utility functions to refresh the instance list

func NewServiceDiscoveryFromMap

func NewServiceDiscoveryFromMap(m map[string]ServerAddress) (sd *ServerDiscovery)

func (*ServerDiscovery) GetInstances

func (sd *ServerDiscovery) GetInstances() (addresses []ServerAddress)

GetInstances returns a copy of the latest known list of addresses call RefreshBySrvIfAvailable prior to this in order to get a more up-to-date view

func (*ServerDiscovery) GetInstancesAsMap

func (sd *ServerDiscovery) GetInstancesAsMap() (addresses map[string]ServerAddress)

func (*ServerDiscovery) GetInstancesAsStrings

func (sd *ServerDiscovery) GetInstancesAsStrings() (addresses []string)

func (*ServerDiscovery) RefreshBySrvIfAvailable

func (sd *ServerDiscovery) RefreshBySrvIfAvailable()

RefreshBySrvIfAvailable performs a DNS SRV lookup and updates list with the results of the lookup

type ServerSrvAddress

type ServerSrvAddress string

func (ServerSrvAddress) LookUp

func (r ServerSrvAddress) LookUp() (addresses []ServerAddress, err error)

LookUp may return an error for some records along with successful lookups - make sure you do not discard `addresses` even if `err == nil`

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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