client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: Apache-2.0 Imports: 18 Imported by: 3

Documentation

Index

Constants

View Source
const (
	REGISTRATION_NAME = `registration`
	REGISTRATION_PERM = 0600
)
View Source
const (
	AUTH_NAME = "credentials"
)
View Source
const (
	// Path to Linux hardware UUID file under /sys
	LINUX_SYSTEM_UUID_PATH = "/sys/class/dmi/id/product_uuid"
)

Variables

View Source
var (
	ErrClientNotAuthorized    = errClientNotAuthorized()    // general authorization failure
	ErrRegistrationRequired   = errRegistrationRequired()   // need to (re-)register
	ErrAuthenticationRequired = errAuthenticationRequired() // need to (re-authenticate)
)

Functions

This section is empty.

Types

type TelemetryAuth

type TelemetryAuth struct {
	// TODO: unify these fields with restapi.ClientRegistrationResponse
	RegistrationId   int64                    `json:"registrationId"`
	Token            types.TelemetryAuthToken `json:"authToken"`
	RegistrationDate types.TelemetryTimeStamp `json:"registrationDate"`
}

TODO: unify with restapi.ClientRegistrationResponse

type TelemetryClient

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

func NewTelemetryClient

func NewTelemetryClient(cfg *config.Config) (*TelemetryClient, error)

func (*TelemetryClient) AuthAccessible

func (tc *TelemetryClient) AuthAccessible() bool

func (*TelemetryClient) AuthExpiration

func (tc *TelemetryClient) AuthExpiration() (expiration time.Time, err error)

func (*TelemetryClient) AuthIssuer

func (tc *TelemetryClient) AuthIssuer() (issuer string, err error)

func (*TelemetryClient) AuthPath

func (tc *TelemetryClient) AuthPath() string

func (*TelemetryClient) Authenticate

func (tc *TelemetryClient) Authenticate() (err error)

Authenticate is responsible for (re)authenticating an already registered client with the server to ensure that it's auth token is up to date.

func (*TelemetryClient) ClientId

func (tc *TelemetryClient) ClientId() string

func (*TelemetryClient) CreateBundles

func (tc *TelemetryClient) CreateBundles(tags types.Tags) error

func (*TelemetryClient) CreateReports

func (tc *TelemetryClient) CreateReports(tags types.Tags) (err error)

func (*TelemetryClient) Generate

func (tc *TelemetryClient) Generate(telemetry types.TelemetryType, content *types.TelemetryBlob, tags types.Tags) error

func (*TelemetryClient) HasAuth

func (tc *TelemetryClient) HasAuth() bool

func (*TelemetryClient) Processor

func (*TelemetryClient) Register

func (tc *TelemetryClient) Register() (err error)

func (*TelemetryClient) RegistrationAccessible

func (tc *TelemetryClient) RegistrationAccessible() bool

func (*TelemetryClient) RegistrationPath

func (tc *TelemetryClient) RegistrationPath() string

func (*TelemetryClient) Submit

func (tc *TelemetryClient) Submit() (err error)

type TelemetryClientRegistration

type TelemetryClientRegistration struct {
	types.ClientRegistration
	// contains filtered or unexported fields
}

func NewTelemetryClientRegistration

func NewTelemetryClientRegistration(cfg *config.Config) (*TelemetryClientRegistration, error)

func (*TelemetryClientRegistration) Accessible

func (r *TelemetryClientRegistration) Accessible() bool

func (*TelemetryClientRegistration) DisableRetries

func (r *TelemetryClientRegistration) DisableRetries()

func (*TelemetryClientRegistration) Generate

func (r *TelemetryClientRegistration) Generate() (err error)

func (*TelemetryClientRegistration) Load

func (r *TelemetryClientRegistration) Load() (err error)

func (*TelemetryClientRegistration) Path

func (*TelemetryClientRegistration) Registration

func (*TelemetryClientRegistration) Remove

func (r *TelemetryClientRegistration) Remove() (err error)

func (*TelemetryClientRegistration) RetriesEnabled

func (r *TelemetryClientRegistration) RetriesEnabled() bool

func (*TelemetryClientRegistration) Save

func (r *TelemetryClientRegistration) Save() (err error)

func (*TelemetryClientRegistration) String

func (r *TelemetryClientRegistration) String() string

func (*TelemetryClientRegistration) Valid

func (r *TelemetryClientRegistration) Valid() bool

Jump to

Keyboard shortcuts

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