clientfunk

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package clientfunk contains client-side types and utilities

Index

Constants

View Source
const ClusterfunkSchemaName = "cluster"

ClusterfunkSchemaName is the schema used for the connections. Each server connection uses clusterfunk://[endpointname] when resolving. This should be combined with the service config settings included in this package.

View Source
const GRPCServiceConfig = `{
	"loadBalancingPolicy": "round_robin"
}`

GRPCServiceConfig is the default service config for Clusterfunk clients. It will enable retries when the service is down but not when the call times out.

Variables

This section is empty.

Functions

func ConnectToManagement added in v0.0.7

func ConnectToManagement(client Client) (managepb.ClusterManagementClient, error)

ConnectToManagement connects to the management endpoint by looking up a management endpoint via the client. This is a convenience method

func SetResolverLogging added in v1.0.6

func SetResolverLogging(enable bool)

SetResolverLogging turns on and off detailed tracing of the resolver's returns. This can aid in debugging

Types

type Client added in v0.0.7

type Client interface {
	// WaitForEndpoint waits for an endpoint to become available.
	WaitForEndpoint(name string)

	// Endpoints returns all of the available endpoints
	Endpoints() []funk.Endpoint

	// RefreshPeers refreshes the list of peers. This ensures you'll have a
	// reasonable updated worldview.
	RefreshPeers()

	funk.EndpointRegistrator
}

Client is a cluster client interface.

func NewClusterClient added in v0.0.7

func NewClusterClient(params ClientParameters) (Client, error)

NewClusterClient creates a new cluster client. clusterName is the name of the cluster. If zeroConf is set to true mDNS/ZeroConf will be used to find a serf node to attach to. If the zeroConf parameter is set to false the seedNode parameter is used to attach to a Serf node.

type ClientParameters added in v0.0.23

type ClientParameters struct {
	ClusterName     string   `kong:"help='Name of cluster',default='clusterfunk'"`
	Name            string   `kong:"help='Client name',default='client'"`
	ZeroConf        bool     `kong:"help='Enable/disable ZeroConf/mDNS for cluster lookups',default='true'"`
	SerfJoinAddress []string `kong:"help='Serf nodes to join'"`
	Verbose         bool     `kong:"help='Verbose logging'"`
}

ClientParameters is the client configuration parameters

Jump to

Keyboard shortcuts

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