cmd

package
v0.22.8 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TidbytAPIPush = "https://api.tidbyt.com/v0/devices/%s/push"
	APITokenEnv   = "TIDBYT_API_TOKEN"
)
View Source
const PublicKeysetJSON = `` /* 543-byte string literal not displayed */
View Source
const (
	TidbytAPIListDevices = "https://api.tidbyt.com/v0/devices"
)

Variables

View Source
var DevicesCmd = &cobra.Command{
	Use:   "devices",
	Short: "List devices in your Tidbyt account",
	Run:   devices,
}
View Source
var EncryptCmd = &cobra.Command{
	Use:     "encrypt [app name] [secret value]...",
	Short:   "Encrypt a secret for use in the Tidbyt community repo",
	Example: "encrypt weather my-top-secretweather-api-key-123456",
	Args:    cobra.MinimumNArgs(2),
	Run:     encrypt,
}
View Source
var LoginCmd = &cobra.Command{
	Use:     "login",
	Short:   "Login to your Tidbyt account",
	Example: "login",
	Run:     login,
}
View Source
var ProfileCmd = &cobra.Command{
	Use:   "profile [script] [<key>=value>]...",
	Short: "Run a Pixlet script and print its execution-time profile",
	Args:  cobra.MinimumNArgs(1),
	Run:   profile,
}
View Source
var PushCmd = &cobra.Command{
	Use:   "push [device ID] [webp image]",
	Short: "Render a Pixlet script and push the WebP output to a Tidbyt",
	Args:  cobra.MinimumNArgs(2),
	Run:   push,
}
View Source
var RenderCmd = &cobra.Command{
	Use:   "render [script] [<key>=value>]...",
	Short: "Run a Pixlet script with provided config parameters",
	Args:  cobra.MinimumNArgs(1),
	Run:   render,
}
View Source
var ServeCmd = &cobra.Command{
	Use:   "serve [script]",
	Short: "Serve a Pixlet app in a web server",
	Args:  cobra.ExactArgs(1),
	RunE:  serve,
}
View Source
var Version string
View Source
var VersionCmd = &cobra.Command{
	Use:   "version",
	Short: "Show the version of Pixlet",
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Printf("Pixlet version: %s\n", Version)
	},
}

Functions

This section is empty.

Types

type FetchFunc added in v0.17.16

type FetchFunc func(src string, duration, timeout time.Duration) (*pprof_profile.Profile, string, error)

We save the profile into an in-memory buffer, which is simpler than the tool expects. Simple adapter to pipe it through.

func MakeFetchFunc added in v0.17.16

func MakeFetchFunc(prof *pprof_profile.Profile) FetchFunc

func (FetchFunc) Fetch added in v0.17.16

func (f FetchFunc) Fetch(src string, duration, timeout time.Duration) (*pprof_profile.Profile, string, error)

type TidbytPushJSON

type TidbytPushJSON struct {
	DeviceID       string `json:"deviceID"`
	Image          string `json:"image"`
	InstallationID string `json:"installationID"`
	Background     bool   `json:"background"`
}

Jump to

Keyboard shortcuts

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