client

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2025 License: BSD-3-Clause-Clear Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserAgentPrefix = "fioup/"

	HeaderKeyTag    = "x-ats-tags"
	HeaderKeyApps   = "x-ats-dockerapps"
	HeaderKeyTarget = "x-ats-target"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Device added in v0.9.0

type Device struct {
	RepoId    string      `json:"repo_id"`
	Uuid      string      `json:"uuid"`
	Name      string      `json:"name"`
	CreatedAt DgTimeStamp `json:"created_at"`
	LastSeen  DgTimeStamp `json:"last_seen"`
	PubKey    string      `json:"pubkey"`
	Tag       string      `json:"tag"`
}

type DgTimeStamp added in v0.9.0

type DgTimeStamp float32

func (DgTimeStamp) AsTime added in v0.9.0

func (ts DgTimeStamp) AsTime() time.Time

type GatewayClient

type GatewayClient struct {
	BaseURL    *url.URL
	HttpClient *http.Client
	Headers    map[string]string
	// contains filtered or unexported fields
}

func NewGatewayClient

func NewGatewayClient(cfg *config.Config, apps []string, targetID string) (*GatewayClient, error)

func (*GatewayClient) Get

func (c *GatewayClient) Get(resourcePath string) (*transport.HttpRes, error)

func (*GatewayClient) Post

func (c *GatewayClient) Post(resourcePath string, data any) (*transport.HttpRes, error)

func (*GatewayClient) Put added in v0.9.0

func (c *GatewayClient) Put(resourcePath string, data any) (*transport.HttpRes, error)

func (*GatewayClient) PutSysInfo added in v0.9.0

func (c *GatewayClient) PutSysInfo() error

PutSysInfo sends the "system-info" API data to the gateway. It only sends each piece of data if it has changed since the last time this function was invoked.

func (GatewayClient) Self added in v0.9.0

func (c GatewayClient) Self() (*Device, error)

func (*GatewayClient) UpdateHeaders

func (c *GatewayClient) UpdateHeaders(apps []string, targetID string)

Jump to

Keyboard shortcuts

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