Documentation
¶
Index ¶
- Constants
- type AppServiceState
- type AppState
- type AppStates
- type Device
- type DgTimeStamp
- type GatewayClient
- func (c *GatewayClient) Get(resourcePath string) (*transport.HttpRes, error)
- func (c *GatewayClient) Post(resourcePath string, data any) (*transport.HttpRes, error)
- func (c *GatewayClient) Put(resourcePath string, data any) (*transport.HttpRes, error)
- func (c *GatewayClient) PutSysInfo() error
- func (c *GatewayClient) ReportAppStates(ctx context.Context, cfg *compose.Config) error
- func (c *GatewayClient) Self() (*Device, error)
- func (c *GatewayClient) UpdateHeaders(apps []string, targetID string)
- type GatewayClientOpt
- type GatewayClientOpts
- type GwHttpOperations
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 AppServiceState ¶ added in v1.0.0
type AppState ¶ added in v1.0.0
type AppState struct {
Services []AppServiceState `json:"services"`
State string `json:"state"`
Uri string `json:"uri"`
}
type Device ¶ added in v0.9.0
type Device struct {
Factory string `json:"factory"`
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, options ...GatewayClientOpt) (*GatewayClient, error)
func (*GatewayClient) Get ¶
func (c *GatewayClient) Get(resourcePath string) (*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) ReportAppStates ¶ added in v1.0.0
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)
type GatewayClientOpt ¶ added in v1.1.0
type GatewayClientOpt func(*GatewayClientOpts)
func WithHttpOperations ¶ added in v1.1.0
func WithHttpOperations(ops GwHttpOperations) GatewayClientOpt
type GatewayClientOpts ¶ added in v1.1.0
type GatewayClientOpts struct {
HttpOperations GwHttpOperations
}
Click to show internal directories.
Click to hide internal directories.