imgur

package
v0.0.0-...-3a06bfb Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const API = "https://api.imgur.com/3/image"

Variables

View Source
var AppSchema = schema.StructFunc(func(prototype *App) *schema.StructBuilder[App] {
	return schema.Struct(prototype,
		schema.F("clientId", &prototype.ClientId, schema.String()),
	).DebugName("App")
})
View Source
var ApplierSchema = schema.StructFunc(func(prototype *Applier) *schema.StructBuilder[Applier] {
	return schema.Struct(prototype,
		schema.F("App", &prototype.App, AppSchema),
	).DebugName("upload.imgur#Applier")
})
View Source
var ConfigSchema = schema.StructFunc(func(prototype *Config) *schema.StructBuilder[Config] {
	return schema.Struct(prototype,
		schema.F("apps", &prototype.Apps, schema.Map(AppSchema)),
		schema.F("default", &prototype.Default, schema.String().Default("")),
	).DebugName("upload.imgur#Config")
})
View Source
var ParamsSchema = schema.StructFunc(func(prototype *Params) *schema.StructBuilder[Params] {
	return schema.Struct(prototype,
		schema.F("app", &prototype.AppName, schema.String().Default("")),
	).DebugName("upload.imgur#Params")
})

Functions

func Register

func Register(r *transform.Registry)

Types

type App

type App struct {
	ClientId string `imbed:"clientId"`
}

func (*App) EncodeMsg

func (x *App) EncodeMsg(w *fastbuf.W)

type Applier

type Applier struct {
	App `imbed:""`
}

func (*Applier) Apply

func (u *Applier) Apply(app core.App, a asset.Asset) (asset.Update, error)

func (*Applier) EncodeMsg

func (x *Applier) EncodeMsg(w *fastbuf.W)

type Config

type Config struct {
	Apps    map[string]App `imbed:"apps"`
	Default string         `imbed:"default,\"\""`
}

func (*Config) EncodeMsg

func (x *Config) EncodeMsg(w *fastbuf.W)

func (*Config) Validate

func (c *Config) Validate() error

type Params

type Params struct {
	AppName string `imbed:"app,\"\""`
}

func (*Params) BuildTransform

func (p *Params) BuildTransform(c *Config) (transform.Applier, error)

func (*Params) EncodeMsg

func (x *Params) EncodeMsg(w *fastbuf.W)

Jump to

Keyboard shortcuts

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