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

component

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CloudflaredName = "cloudflared"
)

Variables

View Source
var (
	ErrNotInstalled = errors.New("cloudflared component is not installed")
	ErrBroken       = errors.New("cloudflared component is broken")
)

Functions

func DefaultRuntimeRoot

func DefaultRuntimeRoot() string

func LegacyPaths

func LegacyPaths(string) []string

Types

type Catalog

type Catalog struct {
	SchemaVersion int                `json:"schema_version"`
	Revision      int                `json:"revision"`
	Components    []CatalogComponent `json:"components"`
}

func ParseCatalog

func ParseCatalog(data []byte) (Catalog, error)

type CatalogArtifact

type CatalogArtifact struct {
	OS        string `json:"os"`
	Arch      string `json:"arch"`
	Format    string `json:"format"`
	URL       string `json:"url"`
	MirrorURL string `json:"mirror_url,omitempty"`
	SHA256    string `json:"sha256"`
}

type CatalogCompatibility

type CatalogCompatibility struct {
	MinVersion          string `json:"min_version"`
	MaxVersionExclusive string `json:"max_version_exclusive"`
}

type CatalogComponent

type CatalogComponent struct {
	Component       string               `json:"component"`
	Version         string               `json:"version"`
	Status          string               `json:"status"`
	AgentDock       CatalogCompatibility `json:"agentdock"`
	UpstreamVersion string               `json:"upstream_version"`
	UpstreamSource  string               `json:"upstream_source"`
	Artifacts       []CatalogArtifact    `json:"artifacts"`
}

func SelectCloudflaredEntry

func SelectCloudflaredEntry(catalog Catalog, agentdockVersion string) (CatalogComponent, error)

type InstallOptions

type InstallOptions struct {
	RuntimeRoot      string
	CatalogURL       string
	AgentDockVersion string
	HTTPClient       *http.Client
	GOOS             string
	GOARCH           string
	Progress         func(ProgressEvent)
	LegacyPaths      []string
}

type ProgressEvent

type ProgressEvent struct {
	Type  string `json:"type"`
	Stage string `json:"stage,omitempty"`
	Bytes int64  `json:"bytes,omitempty"`
	Total int64  `json:"total,omitempty"`
}

type Status

type Status struct {
	Component string `json:"component"`
	State     string `json:"state"`
	Installed bool   `json:"installed"`
	Ready     bool   `json:"ready"`
	Version   string `json:"version,omitempty"`
	Path      string `json:"path,omitempty"`
	SHA256    string `json:"sha256,omitempty"`
	Detail    string `json:"detail,omitempty"`
}

type Store

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

func NewStore

func NewStore(runtimeRoot string) (*Store, error)

func (*Store) ImportLegacy

func (store *Store) ImportLegacy(ctx context.Context, source string) (Status, error)

func (*Store) Install

func (store *Store) Install(ctx context.Context, options InstallOptions) (Status, error)

func (*Store) Resolve

func (store *Store) Resolve() (string, error)

func (*Store) Status

func (store *Store) Status() Status

func (*Store) Uninstall

func (store *Store) Uninstall() error

func (*Store) Update

func (store *Store) Update(ctx context.Context, options InstallOptions) (Status, error)

Jump to

Keyboard shortcuts

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