service

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ID        string       `json:"id"`
	Type      ServiceType  `json:"type"`
	Name      string       `json:"name"`
	Endpoints EndpointList `json:"endpoints"`
	Zones     []string     `json:"zones"`
	ACLs      acl.Policy   `json:"acls"`
	NoPublish bool         `json:"no_publish"`
	UseProxy  bool         `json:"use_proxy"`
	Handler   Handler      `json:"-"`
}

func FromConsulInstances

func FromConsulInstances(tags []string, instances []*api.CatalogService, extrCfg ExtractConfig) (*Config, error)

func (*Config) MarshalZerologObject

func (c *Config) MarshalZerologObject(u *zerolog.Event)

func (*Config) UnmarshalJSON

func (c *Config) UnmarshalJSON(data []byte) error

type Endpoint

type Endpoint struct {
	Address net.IP
	Port    uint16
}

func (Endpoint) MarshalZerologObject

func (e Endpoint) MarshalZerologObject(u *zerolog.Event)

func (Endpoint) String

func (e Endpoint) String() string

func (*Endpoint) UnmarshalJSON

func (e *Endpoint) UnmarshalJSON(data []byte) error

type EndpointList

type EndpointList []Endpoint

func (EndpointList) MarshalZerologArray

func (el EndpointList) MarshalZerologArray(a *zerolog.Array)

type ExtractConfig

type ExtractConfig struct {
	ServiceTag   string
	NoPublishTag string
	NameKey      string
	ZoneKey      string
	ACLKey       string
	UseProxyKey  string
}

type Handler

type Handler string

Handler names a built-in cadet handler that serves a service's route in place of reverse-proxying to its endpoints.

const (
	// NoHandler services are reverse-proxied to their endpoints.
	NoHandler Handler = ""
	// DashboardHandler services are served by the cadet web UI.
	DashboardHandler Handler = "dashboard"
)

func (Handler) IsValid

func (h Handler) IsValid() bool

func (Handler) String

func (h Handler) String() string

type Map

type Map map[string]*Config

func CombineServiceMaps

func CombineServiceMaps(svcMaps []Map) Map

type ServiceType

type ServiceType string
const (
	HTTP ServiceType = "http"
	TCP  ServiceType = "tcp"
	UDP  ServiceType = "udp"
)

func (ServiceType) IsEmpty

func (s ServiceType) IsEmpty() bool

func (ServiceType) IsValid

func (s ServiceType) IsValid() bool

func (ServiceType) String

func (s ServiceType) String() string

Jump to

Keyboard shortcuts

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