docker

package
v0.0.0-...-68b491e Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Discovery

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

func NewDiscovery

func NewDiscovery(ctx context.Context, db db.Tool, transport Transporter, log *slog.Logger) (*Discovery, error)

NewDiscovery returns a pointer to a refreshed Discovery.

func (*Discovery) All

func (di *Discovery) All(ctx context.Context) []tool.Tool

All returns all Tools from the database.

func (*Discovery) Get

func (di *Discovery) Get(ctx context.Context, name string) (tool.Tool, error)

Get returns the Tool for the given name from the database.

func (*Discovery) Refresh

func (di *Discovery) Refresh(ctx context.Context) error

Refresh clears the database and adds any Tools found on the docker socket to the database. To set a timeout use the ctx.

type Transporter

type Transporter interface {
	Get(ctx context.Context, addr string, header map[string][]string) ([]byte, error)
}

Jump to

Keyboard shortcuts

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