localfetcher

package
v0.0.0-...-86b787e Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const ZeroUUID = "00000000-0000-0000-0000-000000000000"

Variables

This section is empty.

Functions

func Base

func Base() string

func Checkin

func Checkin(key, baseurl string, ctx context.Context)

func DecodeKey

func DecodeKey(s string) (*[32]byte, error)

func URLs

func URLs(isServer bool, version string) []string

func UrlForSensor

func UrlForSensor(version string) string

func UrlForServer

func UrlForServer(version string) string

Types

type CanDooer

type CanDooer struct {
	UUID uuid.UUID
	Pub  *otrbox.Pub
	Prv  *otrbox.Prv
}

func NewCanDooer

func NewCanDooer() (*CanDooer, error)

func (*CanDooer) Sanity

func (cd *CanDooer) Sanity()

type KushtakaFetcher

type KushtakaFetcher struct {
	CanDooer     *models.CanDooer
	APIKey       string
	Interval     time.Duration
	IsServer     bool
	CheckHeaders []string
	// contains filtered or unexported fields
}

HTTP fetcher uses HEAD requests to poll the status of a given file. If it detects this file has been updated, it will fetch and return its io.Reader stream.

func (*KushtakaFetcher) Fetch

func (h *KushtakaFetcher) Fetch(currentVersion string) (io.Reader, string, error)

Fetch the binary from the provided URL

func (*KushtakaFetcher) Init

func (h *KushtakaFetcher) Init() error

Init validates the provided config

type ServerStatus

type ServerStatus struct {
	// contains filtered or unexported fields
}
var Status *ServerStatus

func NewServerStatus

func NewServerStatus() *ServerStatus

func (*ServerStatus) IsLicensed

func (ss *ServerStatus) IsLicensed() bool

func (*ServerStatus) SetIsLicensed

func (ss *ServerStatus) SetIsLicensed(b bool)

Jump to

Keyboard shortcuts

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