booruchan

package module
Version: v0.0.0-...-ebde851 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package booruchan wraps various booru apis in golang

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	DanbooruService *DanbooruService
	YandereService  *YandereService
	KonachanService *KonachanService
	GelbooruService *GelbooruService
}

Client for various boorus

func NewClient

func NewClient(httpClient *http.Client) *Client

NewClient returns a new Client

type Danbooru

type Danbooru []struct {
	HasComments bool   `json:"has_comments"`
	ParentID    int    `json:"parent_id"`
	Status      string `json:"status"`
	HasChildren bool   `json:"has_children"`
	CreatedAt   string `json:"created_at"`
	HasNotes    bool   `json:"has_notes"`
	Rating      string `json:"rating"`
	Author      string `json:"author"`
	CreatorID   int    `json:"creator_id"`
	Width       int    `json:"width"`
	Source      string `json:"source"`
	Score       int    `json:"score"`
	Tags        string `json:"tags"`
	Height      int    `json:"height"`
	FileSize    int    `json:"file_size"`
	ID          int    `json:"id"`
	FileURL     string `json:"file_url"`
	PreviewURL  string `json:"preview_url"`
	Md5         string `json:"md5"`
}

Danbooru json API Struct https://danbooru.donmai.us/post/index.json

type DanbooruService

type DanbooruService struct {
	// contains filtered or unexported fields
}

DanbooruService is results from danbooru using sites

func NewDanbooruService

func NewDanbooruService(httpClient *http.Client) *DanbooruService

NewDanbooruService returns a new DanbooruService.

func (*DanbooruService) SearchByMD5

func (s *DanbooruService) SearchByMD5(md5sum string) (Danbooru, *http.Response, error)

SearchByMD5 searches Danbooru by md5 and returns results

func (*DanbooruService) SearchByPostID

func (s *DanbooruService) SearchByPostID(postID int) (Danbooru, *http.Response, error)

SearchByPostID searches danbooru by post id and returns results

type Gelbooru

type Gelbooru []struct {
	Source       string      `json:"source"`
	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       int         `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"`
	CreatedAt    string      `json:"created_at"`
}

Gelbooru json api struct https://gelbooru.com/index.php?page=dapi&s=post&tags=md5%3a2649297cc3c60072ad9c8cfd8b26bb2d&json=1&q=index for tags: https://gelbooru.com/index.php?page=dapi&s=tag&tags=md5%3a2649297cc3c60072ad9c8cfd8b26bb2d&json=1&q=index

type GelbooruService

type GelbooruService struct {
	// contains filtered or unexported fields
}

GelbooruService is results from gelbooru

func NewGelbooruService

func NewGelbooruService(httpClient *http.Client) *GelbooruService

NewGelbooruService returns a new KonachanService.

func (*GelbooruService) SearchByMD5

func (s *GelbooruService) SearchByMD5(md5sum string) (Gelbooru, *http.Response, error)

SearchByMD5 searches gelbooru by md5 and returns results

func (*GelbooruService) SearchByPostID

func (s *GelbooruService) SearchByPostID(postID int) (Gelbooru, *http.Response, error)

SearchByPostID searches gelbooru by post id and returns results

type Konachan

type Konachan []struct {
	ID                  int           `json:"id"`
	Tags                string        `json:"tags"`
	CreatedAt           int           `json:"created_at"`
	CreatorID           int           `json:"creator_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"`
	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"`
	HasChildren         bool          `json:"has_children"`
	ParentID            interface{}   `json:"parent_id"`
	Status              string        `json:"status"`
	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"`
}

Konachan json api struct https://konachan.com/post.json?limit=1 https://konachan.net/post.json?limit=1

type KonachanService

type KonachanService struct {
	// contains filtered or unexported fields
}

KonachanService is results from konachan

func NewKonachanService

func NewKonachanService(httpClient *http.Client) *KonachanService

NewKonachanService returns a new KonachanService.

func (*KonachanService) SearchByMD5

func (s *KonachanService) SearchByMD5(md5sum string, tld string) (Konachan, *http.Response, error)

SearchByMD5 searches konachan.com/net by md5 and returns results

func (*KonachanService) SearchByPostID

func (s *KonachanService) SearchByPostID(postID int, tld string) (Konachan, *http.Response, error)

SearchByPostID searches konachan by post id and returns results

type Yandere

type Yandere []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"`
}

Yandere json api struct //https://yande.re/post.json

type YandereService

type YandereService struct {
	// contains filtered or unexported fields
}

YandereService is results from yandere

func NewYandereService

func NewYandereService(httpClient *http.Client) *YandereService

NewYandereService returns a new YandereService.

func (*YandereService) SearchByMD5

func (s *YandereService) SearchByMD5(md5sum string) (Yandere, *http.Response, error)

SearchByMD5 searches yandere by md5 and returns results

func (*YandereService) SearchByPostID

func (s *YandereService) SearchByPostID(postID int) (Yandere, *http.Response, error)

SearchByPostID searches yandere by post id and returns results

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL