notehub

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

View Source
const DefaultAPIService = "api.notefile.net"

DefaultAPIService (golint)

View Source
const HubAppGetSchemas = "hub.app.schemas.get"

HubAppGetSchemas (golint)

View Source
const HubAppGetTransform = "hub.app.transform.get"

HubAppGetTransform (golint)

View Source
const HubAppSetTransform = "hub.app.transform.set"

HubAppSetTransform (golint)

View Source
const HubAppUpload = "hub.app.upload.add"

HubAppUpload (golint)

View Source
const HubAppUploadDelete = "hub.app.upload.delete"

HubAppUploadDelete (golint)

View Source
const HubAppUploadRead = "hub.app.upload.get"

HubAppUploadRead (golint)

View Source
const HubAppUploadSet = "hub.app.upload.set"

HubAppUploadSet (golint)

View Source
const HubAppUploads = "hub.app.upload.query"

HubAppUploads (golint)

View Source
const HubCompressModeCobs = "cobs"

HubCompressModeCobs (golint)

View Source
const HubCompressModeSnappy = "snappy"

HubCompressModeSnappy (golint)

View Source
const HubDeviceContact = "hub.device.contact"

HubDeviceContact (golint)

View Source
const HubEnvGet = "hub.env.get"

HubEnvGet (golint)

View Source
const HubEnvScopeApp = "app"

HubEnvScopeApp (golint)

View Source
const HubEnvScopeDevice = "device"

HubEnvScopeDevice (golint)

View Source
const HubEnvScopeFleet = "fleet"

HubEnvScopeFleet (golint)

View Source
const HubEnvScopeFleets = "fleets"

HubEnvScopeFleets (golint)

View Source
const HubEnvScopeProject = "project"

HubEnvScopeProject (golint)

View Source
const HubEnvSet = "hub.env.set"

HubEnvSet (golint)

View Source
const HubEventQuery = "hub.app.event.query"

HubEventQuery (golint)

View Source
const HubQuery = "hub.app.data.query"

HubQuery (golint)

View Source
const HubRequestFileTagPublish = "publish"

HubRequestFileTagPublish indicates that this should be published in the UI

View Source
const HubSessionQuery = "hub.app.session.query"

HubSessionQuery (golint)

View Source
const HubUpload = "hub.upload.add"

HubUpload (golint)

View Source
const HubUploadDelete = "hub.upload.delete"

HubUploadDelete (golint)

View Source
const HubUploadRead = "hub.upload.get"

HubUploadRead (golint)

View Source
const HubUploadSet = "hub.upload.set"

HubUploadSet (golint)

View Source
const HubUploads = "hub.upload.query"

HubUploads (golint)

View Source
const TestFirmwareString = "(test firmware)"

Variables

This section is empty.

Functions

This section is empty.

Types

type DbQuery

type DbQuery struct {
	Columns    string `json:"columns,omitempty"`
	Format     string `json:"format,omitempty"`
	Count      bool   `json:"count,omitempty"`
	Offset     int    `json:"offset,omitempty"`
	Limit      int    `json:"limit,omitempty"`
	NoHeader   bool   `json:"noheader,omitempty"`
	Where      string `json:"where,omitempty"`
	Last       string `json:"last,omitempty"`
	Order      string `json:"order,omitempty"`
	Descending bool   `json:"descending,omitempty"`
}

DbQuery is the structure for a database query

type HubRequest

type HubRequest struct {
	notecard.Request `json:",omitempty"`
	Contact          *note.Contact                 `json:"contact,omitempty"`
	AppUID           string                        `json:"app,omitempty"`
	FleetUID         string                        `json:"fleet,omitempty"`
	EventSerials     []string                      `json:"events,omitempty"`
	DbQuery          *DbQuery                      `json:"query,omitempty"`
	Uploads          []UploadMetadata              `json:"uploads,omitempty"`
	Contains         string                        `json:"contains,omitempty"`
	Handlers         *[]string                     `json:"handlers,omitempty"`
	FileType         UploadType                    `json:"type,omitempty"`
	FileTags         string                        `json:"tags,omitempty"`
	FileNotes        string                        `json:"filenotes,omitempty"`
	Provision        bool                          `json:"provision,omitempty"`
	Scope            string                        `json:"scope,omitempty"`
	Env              *map[string]string            `json:"env,omitempty"`
	FleetEnv         *map[string]map[string]string `json:"fleet_env,omitempty"`
	PIN              string                        `json:"pin,omitempty"`
	Compress         string                        `json:"compress,omitempty"`
	MD5              string                        `json:"md5,omitempty"`
	DeviceEndpoint   bool                          `json:"device_endpoint,omitempty"`
}

HubRequest is is the core data structure for notehub-specific requests

type HubRequestFileFirmware

type HubRequestFileFirmware struct {
	// The organization accountable for the firmware - a display string
	Organization string `json:"org,omitempty"`
	// A description of the firmware - a display string
	Description string `json:"description,omitempty"`
	// The name and model number of the product containing the firmware - a display string
	Product string `json:"product,omitempty"`
	// The identifier of the only firmware that will be acceptable and downloaded to this device
	Firmware string `json:"firmware,omitempty"`
	// The composite version number of the firmware, generally major.minor.patch as a string
	Version string `json:"version,omitempty"`
	// The target CPU of the firmware (see notecard/src/board.h)
	Target string `json:"target,omitempty"`
	// The build number of the firmware, for numeric comparison
	Major uint32 `json:"ver_major,omitempty"`
	Minor uint32 `json:"ver_minor,omitempty"`
	Patch uint32 `json:"ver_patch,omitempty"`
	Build uint32 `json:"ver_build,omitempty"`
	// The build number of the firmware, generally just a date and time
	Built string `json:"built,omitempty"`
	// The entity who built or is responsible for the firmware - a display string
	Builder string `json:"builder,omitempty"`
}

HubRequestFileFirmware is firmware-specific metadata

func (HubRequestFileFirmware) VersionString added in v1.7.2

func (metadata HubRequestFileFirmware) VersionString() string

type UploadMetadata added in v1.7.2

type UploadMetadata struct {
	Name     string                  `json:"name,omitempty"`
	Length   int                     `json:"length,omitempty"`
	MD5      string                  `json:"md5,omitempty"`
	CRC32    uint32                  `json:"crc32,omitempty"`
	Created  int64                   `json:"created,omitempty"`
	Modified int64                   `json:"modified,omitempty"`
	Source   string                  `json:"source,omitempty"`
	Contains string                  `json:"contains,omitempty"`
	Found    string                  `json:"found,omitempty"`
	FileType UploadType              `json:"type,omitempty"`
	Tags     string                  `json:"tags,omitempty"`     // comma-separated, no spaces, case-insensitive
	Notes    string                  `json:"notes,omitempty"`    // Should be simple text
	Firmware *HubRequestFileFirmware `json:"firmware,omitempty"` // This value is pulled out of the firmware binary itself
	// Arbitrary metadata that the user may define - we don't interpret the schema at all
	Info map[string]interface{} `json:"info,omitempty"`
}

UploadMetadata is the body of the object uploaded for each file

type UploadType added in v1.7.2

type UploadType string
const (
	UploadTypeUnknown          UploadType = ""
	UploadTypeHostFirmware     UploadType = "firmware"
	UploadTypeNotecardFirmware UploadType = "notecard"
	UploadTypeModemFirmware    UploadType = "modem"
	UploadTypeUserData         UploadType = "data"
)

func ParseUploadType added in v1.7.2

func ParseUploadType(fileType string) UploadType

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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