Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct { Type string `json:"type"` Config map[string]interface{} `json:"config,omitempty"` }
Configuration defines loadable parameters for a given middleware type.
type Duration ¶
Duration defines text marshalling and unmarshalling for `time.Duration`.
func (Duration) MarshalText ¶
MarshalText converts a Duration value into JSON bytes.
func (*Duration) UnmarshalText ¶
UnmarshalText converts the JSON bytes into a Duration value.
type EndpointInfo ¶
type EndpointInfo struct {
Nodes []Node `json:"nodes"`
}
EndpointInfo encapsulates node and service instance information in an object payload.
func (*EndpointInfo) Prepare ¶
func (e *EndpointInfo) Prepare()
Prepare initializes optimized data structures after loading or unmarshalling.
type Endpoints ¶
type Endpoints interface { GetEndpoints(currentIndex int64) (nodes []Node, index int64, useCache bool, err error) AddEndpoints(node Node) (modification *Modification, err error) RemoveEndpoints(nodeID string, serviceNames ...string) (modification *Modification, err error) }
Endpoints handles retrieving and modifiying endpoints (nodes and service instances).
type HealthCheck ¶
type HealthCheck struct { Timeout Duration `json:"timeout"` Interval Duration `json:"interval"` UnhealthyThreshold uint32 `json:"unhealthyThreshold"` HealthyThreshold uint32 `json:"healthyThreshold"` CheckType string `json:"checkType"` CheckConfig map[string]interface{} `json:"checkConfig,omitempty"` }
HealthCheck defines the health check behavior.
type Metadata ¶
type Metadata map[string]interface{}
Metadata is user-defined key/value pairs that can be applied to nodes and services instances.
type Modification ¶
type Modification struct { Index int64 `json:"index"` Node bool `json:"nodeAffected"` Services []string `json:"services"` }
Modification defines the post-modification state after adding or removing nodes and service instances.
type Node ¶
type Node struct { ID uuid.UUID `json:"id"` Geography string `json:"geography"` Datacenter string `json:"datacenter"` Address net.IP `json:"address"` Metadata Metadata `json:"metadata,omitempty"` Services []ServiceInstance `json:"services,omitempty"` }
Node represents a single running server node or sidecar proxy.
type Operation ¶
type Operation struct { Name string `json:"name"` Method string `json:"method"` URIPattern string `json:"uriPattern"` RoutingRules }
Operation defines a single service operation and its operation-scoped routing rules.
type Port ¶
type Port struct { Port int32 `json:"port"` Protocol string `json:"protocol"` Secure bool `json:"secure"` }
Port defines the port and protcol a service is listening on.
type Retry ¶
type Retry struct { Attempts int `json:"attempts"` ResponseClassifier string `json:"responseClassifier,omitempty"` PerTryTimeout Duration `json:"perTryTimeout"` }
Retry defines retry behavior rule.
type RouteInfo ¶
type RouteInfo struct { Services []Service `json:"services"` Global *RoutingRules `json:"global,omitempty"` }
RouteInfo encapsulates services and routes as well as global routing rules.
type Routes ¶
type Routes interface { GetServices(currentIndex int64) (services []Service, index int64, useCache bool, err error) SetService(service Service) (index int64, err error) RemoveService(serviceName string) (index int64, err error) }
Routes handles retrieving and modifiying services and routes.
type RoutingRules ¶
type RoutingRules struct { Selectors []string `json:"selectors,omitempty"` RewriteRules []Configuration `json:"rewriteRules,omitempty"` Timeout *Duration `json:"timeout,omitempty"` Retry *Retry `json:"retry,omitempty"` Policies []Configuration `json:"policies,omitempty"` Middleware interface{} `json:"-"` }
RoutingRules defines the selectors, rewrite rules, retry behavior, and policies for a service or operation.
type Service ¶
type Service struct { Name string `json:"name"` Namespace string `json:"namespace,omitempty"` Description string `json:"description"` Hostname string `json:"hostname,omitempty"` URIPrefix string `json:"uriPrefix"` Version *Version `json:"version,omitempty"` Authentication string `json:"authentication"` RoutingRules Operations []Operation `json:"operations"` HealthCheck *HealthCheck `json:"healthCheck,omitempty"` }
Service defines a service application and its operations and service-scoped routing rules.
type ServiceInstance ¶
type ServiceInstance struct { ID uuid.UUID `json:"id"` Service string `json:"service"` Name string `json:"name,omitempty"` Namespace string `json:"namespace,omitempty"` Principal string `json:"principal,omitempty"` Owner string `json:"owner,omitempty"` Container *Container `json:"container,omitempty"` Ports Ports `json:"ports"` Metadata Metadata `json:"metadata,omitempty"` Labels []string `json:"labels,omitempty"` LabelSet map[string]struct{} `json:"-"` }
ServiceInstance defines a single running instance of a service.
func (*ServiceInstance) Prepare ¶
func (s *ServiceInstance) Prepare()
Prepare initializes optimized data structures after loading or unmarshalling.