gelbooru

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package gelbooru implements a simple library for accessing Gelbooru-based image boards.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Post

type Post struct {
	Directory    string      `json:"directory"`
	Hash         string      `json:"hash"`
	Height       int         `json:"height"`
	ID           int         `json:"id"`
	Image        string      `json:"image"`
	Change       int         `json:"change"`
	Owner        string      `json:"owner"`
	ParentID     interface{} `json:"parent_id"`
	Rating       string      `json:"rating"`
	Sample       bool        `json:"sample"`
	SampleHeight int         `json:"sample_height"`
	SampleWidth  int         `json:"sample_width"`
	Score        int         `json:"score"`
	Tags         string      `json:"tags"`
	Width        int         `json:"width"`
	FileURL      string      `json:"file_url"`
}

Post contains native Gelbooru data

type Provider

type Provider struct {
	URL          *url.URL
	PasswordSalt string
	PostsLimit   int
}

Provider implements gelbooru provider

func New

New creates a new gelbooru provider with configuration

func (*Provider) Auth

func (p *Provider) Auth(config getmoe.AuthConfiguration)

Auth builds query based on AuthConfiguration

func (*Provider) BuildRequest

func (p *Provider) BuildRequest(config getmoe.RequestConfiguration)

BuildRequest builds query based on RequestConfiguration

func (*Provider) New added in v0.5.0

func (p *Provider) New(config getmoe.ProviderConfiguration)

New creates a new gelbooru provider with configuration

func (*Provider) NextPage

func (p *Provider) NextPage()

NextPage increments page by 1

func (*Provider) PageRequest

func (p *Provider) PageRequest() (*http.Request, error)

PageRequest builds page request from URL

func (*Provider) Parse

func (p *Provider) Parse(data []byte) ([]getmoe.Post, error)

Parse parses result from query

Jump to

Keyboard shortcuts

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