models

package
v0.0.0-...-07e58ce Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlreadyExist

func AlreadyExist(id string) (exist bool)

Check if id already exist in database

func GetPreview

func GetPreview(url string) (res string)

func InitDB

func InitDB(dataSourceName string)

Initialise database globally from here

Types

type AnsiGif

type AnsiGif struct {
	Gif      *gif.GIF
	Rendered []RenderedImg
}

func (*AnsiGif) Get

func (g *AnsiGif) Get(url string) (err error)

func (*AnsiGif) Insert

func (g *AnsiGif) Insert(id string) (err error)

func (*AnsiGif) Oops

func (g *AnsiGif) Oops()

If anything bad happen, be cute

func (*AnsiGif) Preview

func (g *AnsiGif) Preview() (res string)

func (*AnsiGif) Render

func (g *AnsiGif) Render()

func (*AnsiGif) Reverse

func (g *AnsiGif) Reverse()

type Api

type Api struct {
	WebUrl  string
	Results []Result
}

Api json models

type GifMedia

type GifMedia struct {
	Url     string
	Dims    []int
	Preview string
	Size    int
}

type MediaType

type MediaType struct {
	Gif GifMedia
}

type RenderedImg

type RenderedImg struct {
	Output string
	Delay  int
}

a rendered image extracted from a gif with its timing

func GetGifFromDb

func GetGifFromDb(id string, rev bool) (imgs []RenderedImg, err error)

Retrieve all images of a gif sorted by frame_nb by default

type Result

type Result struct {
	Tag   []string
	Url   string
	Id    string
	Media []MediaType
}

Jump to

Keyboard shortcuts

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