discovery

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("no endpoints found")

Functions

func TestInject

func TestInject(reg *asm.Registry)

Types

type BackgroundLookup

type BackgroundLookup struct {
	Endpoint Endpoint
	Error    error
}

type Containerd

type Containerd struct {
	Log       *slog.Logger
	Namespace string `asm:"namespace"`
	Client    *containerd.Client
}

func (*Containerd) FindInContainerd

func (c *Containerd) FindInContainerd(ctx context.Context, app string) (Endpoint, error)

func (*Containerd) Lookup

func (c *Containerd) Lookup(ctx context.Context, app string) (Endpoint, chan BackgroundLookup, error)

type Endpoint

type Endpoint interface {
	ServeHTTP(w http.ResponseWriter, req *http.Request)
}

type EndpointFunc

type EndpointFunc func(w http.ResponseWriter, req *http.Request)

func (EndpointFunc) ServeHTTP

func (e EndpointFunc) ServeHTTP(w http.ResponseWriter, req *http.Request)

type HTTPEndpoint

type HTTPEndpoint struct {
	Host string
}

func (*HTTPEndpoint) ServeHTTP

func (h *HTTPEndpoint) ServeHTTP(w http.ResponseWriter, req *http.Request)

type LocalContainerEndpoint

type LocalContainerEndpoint struct {
	Log       *slog.Logger
	HTTP      HTTPEndpoint
	Client    *containerd.Client
	Namespace string
	Dir       string `asm:"static_dir"`
	Id        string
}

func (*LocalContainerEndpoint) ServeHTTP

func (h *LocalContainerEndpoint) ServeHTTP(w http.ResponseWriter, req *http.Request)

type Lookup

type Lookup interface {
	Lookup(ctx context.Context, name string) (Endpoint, chan BackgroundLookup, error)
}

func FailLookup

func FailLookup(bg bool, err error) Lookup

func SlowLookup

func SlowLookup(l Lookup, dur time.Duration) Lookup

type Memory

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

func (*Memory) Lookup

func (m *Memory) Lookup(ctx context.Context, name string) (Endpoint, chan BackgroundLookup, error)

func (*Memory) Register

func (m *Memory) Register(name string, ep Endpoint)

Jump to

Keyboard shortcuts

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