getmoe: github.com/leonidboykov/getmoe/provider/gelbooru Index | Files

package gelbooru

import "github.com/leonidboykov/getmoe/provider/gelbooru"

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

Index

Package Files

post.go provider.go

type Post Uses

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 Uses

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

Provider implements gelbooru provider

func New Uses

func New(config getmoe.ProviderConfiguration) *Provider

New creates a new gelbooru provider with configuration

func (*Provider) Auth Uses

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

Auth builds query based on AuthConfiguration

func (*Provider) BuildRequest Uses

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

BuildRequest builds query based on RequestConfiguration

func (*Provider) New Uses

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

New creates a new gelbooru provider with configuration

func (*Provider) NextPage Uses

func (p *Provider) NextPage()

NextPage increments page by 1

func (*Provider) PageRequest Uses

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

PageRequest builds page request from URL

func (*Provider) Parse Uses

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

Parse parses result from query

Package gelbooru imports 8 packages (graph) and is imported by 1 packages. Updated 2019-03-11. Refresh now. Tools for package owners.