Help us shape the future of Go! Take the 2026 Go Developer Survey

nameresolution

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2021 License: MIT Imports: 0 Imported by: 19

Documentation

Index

Constants

View Source
const (
	// MDNSInstanceName is the instance name which is broadcasted.
	MDNSInstanceName string = "name"
	// MDNSInstanceAddress is the address of the instance.
	MDNSInstanceAddress string = "address"
	// MDNSInstancePort is the port of instance.
	MDNSInstancePort string = "port"
	// MDNSInstanceID is an optional unique instance ID.
	MDNSInstanceID string = "instance"

	// HostAddress is the address of the instance.
	HostAddress string = "HOST_ADDRESS"
	// DaprHTTPPort is the dapr api http port.
	DaprHTTPPort string = "DAPR_HTTP_PORT"
	// DaprPort is the dapr internal grpc port (sidecar to sidecar).
	DaprPort string = "DAPR_PORT"
	// AppPort is the port of the application, http/grpc depending on mode.
	AppPort string = "APP_PORT"
	// AppID is the ID of the application
	AppID string = "APP_ID"
)
View Source
const DefaultNamespace = "default"

DefaultNamespace is the default kubernetes namespace.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metadata

type Metadata struct {
	Properties    map[string]string `json:"properties"`
	Configuration interface{}
}

Metadata contains a name resolution specific set of metadata properties

type ResolveRequest

type ResolveRequest struct {
	ID        string
	Namespace string
	Port      int
	Data      map[string]string
}

ResolveRequest represents service discovery resolver request.

func NewResolveRequest

func NewResolveRequest() *ResolveRequest

NewResolveRequest creates ResolveRequest with the default namespace.

type Resolver

type Resolver interface {
	// Init initializes name resolver.
	Init(metadata Metadata) error
	// ResolveID resolves name to address.
	ResolveID(req ResolveRequest) (string, error)
}

Resolver is the interface of name resolver.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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