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

package moebooru

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

Package moebooru implements a simple library for accessing Moebooru-based image boards.

Source code of Moebooru is available at https://github.com/moebooru/moebooru

Index

Package Files

post.go provider.go

type Post Uses

type Post struct {
    ID                  int           `json:"id"`
    Tags                string        `json:"tags"`
    CreatedAt           int           `json:"created_at"`
    UpdatedAt           int           `json:"updated_at"`
    CreatorID           int           `json:"creator_id"`
    ApproverID          interface{}   `json:"approver_id"`
    Author              string        `json:"author"`
    Change              int           `json:"change"`
    Source              string        `json:"source"`
    Score               int           `json:"score"`
    Md5                 string        `json:"md5"`
    FileSize            int           `json:"file_size"`
    FileExt             string        `json:"file_ext"`
    FileURL             string        `json:"file_url"`
    IsShownInIndex      bool          `json:"is_shown_in_index"`
    PreviewURL          string        `json:"preview_url"`
    PreviewWidth        int           `json:"preview_width"`
    PreviewHeight       int           `json:"preview_height"`
    ActualPreviewWidth  int           `json:"actual_preview_width"`
    ActualPreviewHeight int           `json:"actual_preview_height"`
    SampleURL           string        `json:"sample_url"`
    SampleWidth         int           `json:"sample_width"`
    SampleHeight        int           `json:"sample_height"`
    SampleFileSize      int           `json:"sample_file_size"`
    JpegURL             string        `json:"jpeg_url"`
    JpegWidth           int           `json:"jpeg_width"`
    JpegHeight          int           `json:"jpeg_height"`
    JpegFileSize        int           `json:"jpeg_file_size"`
    Rating              string        `json:"rating"`
    IsRatingLocked      bool          `json:"is_rating_locked"`
    HasChildren         bool          `json:"has_children"`
    ParentID            interface{}   `json:"parent_id"`
    Status              string        `json:"status"`
    IsPending           bool          `json:"is_pending"`
    Width               int           `json:"width"`
    Height              int           `json:"height"`
    IsHeld              bool          `json:"is_held"`
    FramesPendingString string        `json:"frames_pending_string"`
    FramesPending       []interface{} `json:"frames_pending"`
    FramesString        string        `json:"frames_string"`
    Frames              []interface{} `json:"frames"`
    IsNoteLocked        bool          `json:"is_note_locked"`
    LastNotedAt         int           `json:"last_noted_at"`
    LastCommentedAt     int           `json:"last_commented_at"`
    FlagDetail          struct {
        PostID    int         `json:"post_id"`
        Reason    string      `json:"reason"`
        CreatedAt time.Time   `json:"created_at"`
        UserID    interface{} `json:"user_id"`
        FlaggedBy string      `json:"flagged_by"`
    }   `json:"flag_detail"`
}

Post contains native Moebooru data

type Provider Uses

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

Provider implements moebooru provider

func New Uses

func New(config getmoe.ProviderConfiguration) *Provider

New creates a new moebooru 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 moebooru 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 moebooru imports 9 packages (graph) and is imported by 1 packages. Updated 2019-03-11. Refresh now. Tools for package owners.