Documentation
¶
Index ¶
- Constants
- type Animation
- func (a *Animation) ClickAnimation(index int) (State, bool)
- func (a *Animation) ClickDuration(state State) (time.Duration, bool)
- func (a *Animation) Frame(state State, phase int) image.Image
- func (a *Animation) FrameDelay(state State, phase int) time.Duration
- func (a *Animation) PrimaryDuration(state State) time.Duration
- type Client
- func (c *Client) Catalog(ctx context.Context) ([]Entry, error)
- func (c *Client) Install(ctx context.Context, entry Entry) (*Animation, error)
- func (c *Client) InstalledEntries() ([]Entry, error)
- func (c *Client) InstalledEntry(slug string) (Entry, error)
- func (c *Client) LoadInstalled(slug string) (*Animation, error)
- func (c *Client) Preview(ctx context.Context, entry Entry) (*Animation, error)
- type Entry
- type ImageDraw
- type ImageProtocol
- type ImageRenderer
- func (r *ImageRenderer) Clear(writer io.Writer) error
- func (r *ImageRenderer) DeleteImages(writer io.Writer, ids ...uint32) error
- func (r *ImageRenderer) Invalidate()
- func (r *ImageRenderer) Render(writer io.Writer) error
- func (r *ImageRenderer) Set(draw *ImageDraw)
- func (r *ImageRenderer) Support() ImageSupport
- type ImageSupport
- type State
Constants ¶
View Source
const ( DisabledID = "disabled" DefaultManifestURL = "https://petdex.dev/api/manifest/v2" DefaultRankingURL = "https://petdex.dev/api/pets/search?sort=installed&limit=60&includeMeta=0" TrustedAssetHost = "assets.petdex.dev" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Animation ¶
type Animation struct {
// contains filtered or unexported fields
}
func (*Animation) ClickDuration ¶
ClickDuration reports the duration of an authored click action. The boolean is false for ordinary activity states and built-in interactions.
type Client ¶
type Client struct {
RootDir string
ManifestURL string
RankingURL string
HTTPClient *http.Client
TrustedHosts map[string]bool
// TrustedAssetHosts is narrower than TrustedHosts: catalog redirects may use
// petdex.dev, while image and metadata downloads must stay on the asset host.
TrustedAssetHosts map[string]bool
Now func() time.Time
}
func (*Client) InstalledEntries ¶
type Entry ¶
type Entry struct {
Slug string `json:"slug"`
DisplayName string `json:"displayName"`
Kind string `json:"kind,omitempty"`
SubmittedBy string `json:"submittedBy,omitempty"`
SpritesheetURL string `json:"spritesheet"`
PetJSONURL string `json:"petJson,omitempty"`
AssetBase string `json:"assetBase,omitempty"`
SpriteVersion int `json:"spriteVersionNumber"`
Local bool `json:"-"`
}
type ImageProtocol ¶
type ImageProtocol uint8
const ( ImageProtocolNone ImageProtocol = iota ImageProtocolKitty ImageProtocolKittyLocalFile ImageProtocolSixel )
type ImageRenderer ¶
type ImageRenderer struct {
// contains filtered or unexported fields
}
func NewImageRenderer ¶
func NewImageRenderer(support ImageSupport) *ImageRenderer
func NewImageRendererWithCache ¶
func NewImageRendererWithCache(support ImageSupport, cacheDir string) *ImageRenderer
func (*ImageRenderer) DeleteImages ¶
func (r *ImageRenderer) DeleteImages(writer io.Writer, ids ...uint32) error
DeleteImages removes known application-owned Kitty image placements even when this renderer no longer considers them active. This is intended for process shutdown and recovery from a previous interrupted render.
func (*ImageRenderer) Invalidate ¶
func (r *ImageRenderer) Invalidate()
func (*ImageRenderer) Set ¶
func (r *ImageRenderer) Set(draw *ImageDraw)
func (*ImageRenderer) Support ¶
func (r *ImageRenderer) Support() ImageSupport
type ImageSupport ¶
type ImageSupport struct {
Protocol ImageProtocol
Reason string
}
func DetectImageSupport ¶
func DetectImageSupport(getenv func(string) string) ImageSupport
func (ImageSupport) Supported ¶
func (s ImageSupport) Supported() bool
Click to show internal directories.
Click to hide internal directories.