notehub

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: MIT Imports: 20 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 HubAppJobDelete = "hub.app.job.delete"

HubAppJobDelete (golint)

View Source
const HubAppJobGet = "hub.app.job.get"

HubAppJobGet (golint)

View Source
const HubAppJobPut = "hub.app.job.put"

HubAppJobPut (golint)

View Source
const HubAppJobSubmit = "hub.app.job.submit"

HubAppJobSubmit (golint)

View Source
const HubAppJobsGet = "hub.app.jobs.get"

HubAppJobsGet (golint)

View Source
const HubAppReportCancel = "hub.app.report.cancel"

HubAppReportCancel (golint)

View Source
const HubAppReportDelete = "hub.app.report.delete"

HubAppReportDelete (golint)

View Source
const HubAppReportGet = "hub.app.report.get"

HubAppReportGet (golint)

View Source
const HubAppReportsGet = "hub.app.reports.get"

HubAppReportsGet (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 HubDeviceSessionBegin = "hub.device.session.begin"

HubDeviceSessionBegin (golint)

View Source
const HubDeviceSessionEnd = "hub.device.session.end"

HubDeviceSessionEnd (golint)

View Source
const HubDeviceSessionUsage = "hub.device.session.usage"

HubDeviceSessionUsage (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

func RevokeAccessToken added in v1.7.3

func RevokeAccessToken(hub, token string) error

Types

type AccessToken added in v1.7.3

type AccessToken struct {
	Host        string
	Email       string
	AccessToken string
	ExpiresAt   time.Time
}

func InitiateBrowserBasedLogin added in v1.7.3

func InitiateBrowserBasedLogin(notehubApiHost string) (*AccessToken, error)

InitiateBrowserBasedLogin starts the OAuth2 login flow by opening the user's browser. the `hub` parameter is the hostname of Notehub where it is assumed that an OAuth2 client with client ID `notehub_cli` is configured for authorization code flow.

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"`
	Type             *RequestType                  `json:"type,omitempty"` // Shadows Request.Type to handle both int32 and string
	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"`
	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"`
	DryRun           bool                          `json:"dry_run,omitempty"`
}

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

func (*HubRequest) FileType

func (h *HubRequest) FileType() UploadType

func (*HubRequest) SessionType added in v1.7.5

func (h *HubRequest) SessionType() int32

func (*HubRequest) SetFileType added in v1.7.5

func (h *HubRequest) SetFileType(ft UploadType)

func (*HubRequest) SetSessionType added in v1.7.5

func (h *HubRequest) SetSessionType(st int32)

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 RequestType added in v1.7.5

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

RequestType handles the polymorphic "type" field (int32 for sessions, string for uploads)

func (*RequestType) FileType added in v1.7.5

func (rt *RequestType) FileType() UploadType

func (RequestType) MarshalJSON added in v1.7.5

func (rt RequestType) MarshalJSON() ([]byte, error)

func (*RequestType) SessionType added in v1.7.5

func (rt *RequestType) SessionType() int32

func (*RequestType) SetFileType added in v1.7.5

func (rt *RequestType) SetFileType(ft UploadType)

func (*RequestType) SetSessionType added in v1.7.5

func (rt *RequestType) SetSessionType(st int32)

func (*RequestType) UnmarshalJSON added in v1.7.5

func (rt *RequestType) UnmarshalJSON(data []byte) error

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
	Version  string                  `json:"version,omitempty"`  // User-specified version string provided at time of upload
	// 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

func (UploadMetadata) IsArchSpecificNotecardFirmware added in v1.7.3

func (upload UploadMetadata) IsArchSpecificNotecardFirmware() bool

func (UploadMetadata) IsPublished added in v1.7.3

func (upload UploadMetadata) IsPublished() bool

type UploadType added in v1.7.2

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

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