dmm

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: MIT Imports: 10 Imported by: 1

README

Go-DMM

go.dev reference License codecov Go Report Card

Install

go get -u github.com/usk81/go-dmm

enhanced package

go get -u github.com/usk81/go-dmm-enhanced

Usage

e.g. Request to Actress search API:

import (
  "github.com/usk81/go-dmm"
)

ctx := context.TODO()
cli := dmm.NewClient(nil)
result, _, _ := cli.Actresses.First(ctx, nil)
// Actress{
//   ID:          `26617`,
//   Name:        `愛内あみ`,
//   Ruby:        `あいうちあみ`,
//   Bust:        `92`,
//   Cup:         `E`,
//   Waist:       `59`,
//   Hip:         `88`,
//   Height:      `152`,
//   Birthday:    `1987-12-15`,
//   BloodType:   `B`,
//   Hobby:       `音楽鑑賞`,
//   Prefectures: `静岡県`,
//   ImageURL: ImageURL{
//     Small: `http://pics.dmm.co.jp/mono/actjpgs/thumbnail/aiuti_ami.jpg`,
//     Large: `http://pics.dmm.co.jp/mono/actjpgs/aiuti_ami.jpg`,
//   },
//   ListURL: ListURL{
//     Digital: `http://www.dmm.co.jp/digital/videoa/-/list/=/article=actress/id=26617/affiliate-990`,
//     Mono:    `http://www.dmm.co.jp/mono/dvd/-/list/=/article=actress/id=26617/affiliate-990`,
//     Monthly: `http://www.dmm.co.jp/monthly/premium/-/list/=/article=actress/id=26617/affiliate-990`,
//     PPM:     `http://www.dmm.co.jp/ppm/video/-/list/=/article=actress/id=26617/affiliate-990`,
//     Rental:  `http://www.dmm.co.jp/rental/ppr/-/list/=/article=actress/id=26617/affiliate-990`,
//   },
// }

use enhanced package:

import (
  "github.com/usk81/go-dmm"
  "github.com/usk81/go-dmm-enhanced"
)

ctx := context.TODO()
cli := dmm.NewClient(nil)
r, _, _ := cli.Actresses.First(ctx, nil)
result, _ := enhanced.ConvertActress(r)
// Actress{
//   ID:          `26617`,
//   Name:        `愛内あみ`,
//   Ruby:        `あいうちあみ`,
//   Bust:        92,
//   Cup:         `E`,
//   Waist:       59,
//   Hip:         88,
//   Height:      152,
//   Birthday:    `1987-12-15`,
//   BloodType:   `B`,
//   Hobby:       `音楽鑑賞`,
//   Prefectures: `静岡県`,
//   ImageURL: ImageURL{
//     Small: `http://pics.dmm.co.jp/mono/actjpgs/thumbnail/aiuti_ami.jpg`,
//     Large: `http://pics.dmm.co.jp/mono/actjpgs/aiuti_ami.jpg`,
//   },
//   ListURL: ListURL{
//     Digital: `http://www.dmm.co.jp/digital/videoa/-/list/=/article=actress/id=26617/affiliate-990`,
//     Mono:    `http://www.dmm.co.jp/mono/dvd/-/list/=/article=actress/id=26617/affiliate-990`,
//     Monthly: `http://www.dmm.co.jp/monthly/premium/-/list/=/article=actress/id=26617/affiliate-990`,
//     PPM:     `http://www.dmm.co.jp/ppm/video/-/list/=/article=actress/id=26617/affiliate-990`,
//     Rental:  `http://www.dmm.co.jp/rental/ppr/-/list/=/article=actress/id=26617/affiliate-990`,
//   },
// }

Licence

MIT

Author

Yusuke Komatsu

Documentation

Index

Constants

View Source
const (
	// SiteGeneral is the code as DMM.com
	SiteGeneral = "DMM.com"
	// SiteAdult is the code as DMM.co.jp (FANZA)
	SiteAdult = "FANZA"
)
View Source
const AuthorBasePath = `affiliate/v3/AuthorSearch`

AuthorBasePath is used as the base url path to request DMM author API

Variables

This section is empty.

Functions

func CheckResponse

func CheckResponse(r *http.Response) error

CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range. API error responses are expected to have either no response body, or a JSON response body that maps to ErrorResponse. Any other response body will be silently ignored.

func DoRequestWithClient

func DoRequestWithClient(client *http.Client, req *http.Request) (*http.Response, error)

DoRequestWithClient submits an HTTP request using the specified client.

Types

type Actress

type Actress struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Ruby        string   `json:"ruby"`
	Bust        string   `json:"bust"`
	Cup         string   `json:"cup,omitempty"`
	Waist       string   `json:"waist"`
	Hip         string   `json:"hip"`
	Height      string   `json:"height"`
	Birthday    string   `json:"birthday"`
	BloodType   string   `json:"blood_type"`
	Hobby       string   `json:"hobby"`
	Prefectures string   `json:"prefectures"`
	ImageURL    ImageURL `json:"imageURL,omitempty"`
	ListURL     ListURL  `json:"listURL"`
}

Actress represents a actress data

type ActressOptions

type ActressOptions struct {
	APIID       string `json:"api_id" url:"api_id"`
	AffiliateID string `json:"affiliate_id" url:"affiliate_id"`
	Initial     string `json:"initial" url:"initial,omitempty"`
	ActressID   string `json:"actress_id" url:"actress_id,omitempty"`
	Keyword     string `json:"keyword" url:"keyword,omitempty"`
	GteBust     int    `json:"gte_bust" url:"gte_bust,omitempty"`
	LteBust     int    `json:"lte_bust" url:"lte_bust,omitempty"`
	GteWaist    int    `json:"gte_waist" url:"gte_waist,omitempty"`
	LteWaist    int    `json:"lte_waist" url:"lte_waist,omitempty"`
	GteHip      int    `json:"gte_hip" url:"gte_hip,omitempty"`
	LteHip      int    `json:"lte_hip" url:"lte_hip,omitempty"`
	GteHeight   int    `json:"gte_height" url:"gte_height,omitempty"`
	LteHeight   int    `json:"lte_height" url:"lte_height,omitempty"`
	GteBirthday string `json:"gte_birthday" url:"gte_birthday,omitempty"`
	LteBirthday string `json:"lte_birthday" url:"lte_birthday,omitempty"`
	Sort        string `json:"sort" url:"sort,omitempty"`
	Hits        int    `json:"hits" url:"hits,omitempty"`
	Offset      int    `json:"offset" url:"offset,omitempty"`
	Output      string `json:"output" url:"output,omitempty"`
	Callback    string `json:"callback" url:"callback,omitempty"`
}

ActressOptions specifies the optional parameters to various List methods

func (*ActressOptions) GetHits

func (o *ActressOptions) GetHits() int

GetHits gets request hits parameter

func (*ActressOptions) GetOffset

func (o *ActressOptions) GetOffset() int

GetOffset gets request offset parameter

func (*ActressOptions) Next

func (o *ActressOptions) Next() (err error)

Next updates offset

type ActressesService

type ActressesService interface {
	First(context.Context, *ActressOptions) (Actress, *Response, error)
	List(context.Context, *ActressOptions) ([]Actress, *Response, error)
	Unmarshal(context.Context, *ActressOptions, interface{}) (*Response, error)
}

ActressesService is an interface for interfacing with the Actress endpoints of the DMM Affiliate API See: https://affiliate.dmm.com/api/v3/actresssearch.html

type ActressesServiceOp

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

ActressesServiceOp handles communication with the Actress related methods of the DMM Affiliate API.

func (*ActressesServiceOp) First

First gets first actress

func (*ActressesServiceOp) List

List gets all actresses

func (*ActressesServiceOp) Unmarshal

func (s *ActressesServiceOp) Unmarshal(ctx context.Context, opt *ActressOptions, out interface{}) (*Response, error)

Unmarshal parses actress API response

type Author

type Author struct {
	AuthorID    string `json:"author_id"`
	Name        string `json:"name"`
	Ruby        string `json:"ruby"`
	SiteName    string
	SiteCode    string
	ServiceName string
	ServiceCode string
	FloorID     string
	FloorName   string
	FloorCode   string
}

Author represents a author data

type AuthorOptions

type AuthorOptions struct {
	APIID       string `json:"api_id" url:"api_id"`
	AffiliateID string `json:"affiliate_id" url:"affiliate_id"`
	FloorID     string `json:"floor_id" url:"floor_id,omitempty"`
	Initial     string `json:"initial,omitempty" url:"initial,omitempty"`
	Hits        int    `json:"hits" url:"hits,omitempty"`
	Offset      int    `json:"offset" url:"offset,omitempty"`
	Output      string `json:"output" url:"output,omitempty"`
	Callback    string `json:"callback,omitempty" url:"callback,omitempty"`
}

AuthorOptions specifies the optional parameters to various List methods

func (*AuthorOptions) GetHits

func (o *AuthorOptions) GetHits() int

GetHits gets request hits parameter

func (*AuthorOptions) GetOffset

func (o *AuthorOptions) GetOffset() int

GetOffset gets request offset parameter

func (*AuthorOptions) Next

func (o *AuthorOptions) Next() (err error)

Next updates offset

type AuthorsService

type AuthorsService interface {
	First(context.Context, *AuthorOptions) (Author, *Response, error)
	List(context.Context, *AuthorOptions) ([]Author, *Response, error)
	Unmarshal(context.Context, *AuthorOptions, interface{}) (*Response, error)
}

AuthorsService is an interface for interfacing with the Author endpoints of the DMM Affiliate API See: https://affiliate.dmm.com/api/v3/authorsearch.html

type AuthorsServiceOp

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

AuthorsServiceOp handles communication with the Author related methods of the DMM Affiliate API.

func (*AuthorsServiceOp) First

First gets first author

func (*AuthorsServiceOp) List

List gets all authors

func (*AuthorsServiceOp) Unmarshal

func (s *AuthorsServiceOp) Unmarshal(ctx context.Context, opt *AuthorOptions, out interface{}) (*Response, error)

Unmarshal parses author API response

type BandaiInformation

type BandaiInformation struct {
	TitleCode string `json:"titlecode"`
}

BandaiInformation is a information of bandai for a product

type CdInformation

type CdInformation struct {
	Kind string `json:"kind"`
}

CdInformation is a information of cd for a product

type Client

type Client struct {

	// Base URL for API requests.
	BaseURL *url.URL

	// User agent for client
	UserAgent string

	// Services used for communicating with the API
	Actresses ActressesService
	Authors   AuthorsService
	Floors    FloorsService
	Genres    GenresService
	Items     ItemsService
	Makers    MakersService
	Series    SeriesService
	// contains filtered or unexported fields
}

Client manages communication with DMM Affiliate V3 API.

func New

func New(httpClient *http.Client, opts ...ClientOpt) (*Client, error)

New returns a new DIgitalOcean API client instance.

func NewClient

func NewClient(httpClient *http.Client) *Client

NewClient returns a new DMM API client.

func (*Client) Do

func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (response *Response, err error)

Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response will be written to v, without attempting to decode it.

func (*Client) NewRequest

func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)

NewRequest creates an API request. A relative URL can be provided in urlStr, which will be resolved to the BaseURL of the Client. Relative URLS should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included in as the request body.

type ClientOpt

type ClientOpt func(*Client) error

ClientOpt are options for New.

func SetBaseURL

func SetBaseURL(bu string) ClientOpt

SetBaseURL is a client option for setting the base URL.

func SetUserAgent

func SetUserAgent(ua string) ClientOpt

SetUserAgent is a client option for setting the user agent.

type Deliveries

type Deliveries struct {
	Delivery []Delivery `json:"delivery"`
}

Deliveries is a collection that streaming prices

type Delivery

type Delivery struct {
	Type  string `json:"type"`
	Price string `json:"price"`
}

Delivery is a price information for streaming

type ErrResult

type ErrResult struct {
	Status  int               `json:"status"`
	Message string            `json:"message"`
	Errors  map[string]string `json:"errors,omitempty"`
}

An ErrResult reports the error caused by an API request

type ErrorResponse

type ErrorResponse struct {
	// HTTP response that caused this error
	Response *http.Response

	Parameters *ListOptions
	Result     ErrResult `json:"result"`
}

An ErrorResponse reports the error caused by an API request

func (*ErrorResponse) Error

func (r *ErrorResponse) Error() string

type Floor

type Floor struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Code        string `json:"code"`
	SiteName    string
	SiteCode    string
	ServiceName string
	ServiceCode string
}

Floor represents a DMM floor

type FloorOptions

type FloorOptions struct {
	APIID       string `json:"api_id" url:"api_id"`
	AffiliateID string `json:"affiliate_id" url:"affiliate_id"`
	Output      string `json:"output" url:"output,omitempty"`
	Callback    string `json:"callback" url:"callback,omitempty"`
}

FloorOptions specifies the optional parameters to various List methods

func (*FloorOptions) GetHits

func (o *FloorOptions) GetHits() int

GetHits gets request hits parameter

func (*FloorOptions) GetOffset

func (o *FloorOptions) GetOffset() int

GetOffset gets request offset parameter

func (*FloorOptions) Next

func (o *FloorOptions) Next() error

Next updates offset

type FloorsService

type FloorsService interface {
	First(context.Context, *FloorOptions) (Site, *Response, error)
	List(context.Context, *FloorOptions) ([]Site, *Response, error)
	Unmarshal(context.Context, *FloorOptions, interface{}) (*Response, error)
}

FloorsService is an interface for interfacing with the Floor endpoints of the DMM Affiliate API See: https://affiliate.dmm.com/api/v3/floorlist.html

type FloorsServiceOp

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

FloorsServiceOp handles communication with the Floor related methods of the DMM Affiliate API.

func (*FloorsServiceOp) First

func (s *FloorsServiceOp) First(ctx context.Context, opt *FloorOptions) (Site, *Response, error)

First gets first site and floors

func (*FloorsServiceOp) List

func (s *FloorsServiceOp) List(ctx context.Context, opt *FloorOptions) ([]Site, *Response, error)

List gets all floors

func (*FloorsServiceOp) Unmarshal

func (s *FloorsServiceOp) Unmarshal(ctx context.Context, opt *FloorOptions, out interface{}) (*Response, error)

Unmarshal parses floor API response

type Genre

type Genre struct {
	GenreID     string `json:"genre_id"`
	Name        string `json:"name"`
	Ruby        string `json:"ruby"`
	ListURL     string `json:"list_url"`
	SiteName    string
	SiteCode    string
	ServiceName string
	ServiceCode string
	FloorID     string
	FloorName   string
	FloorCode   string
}

Genre represents a DMM genre

type GenreOptions

type GenreOptions struct {
	APIID       string `json:"api_id" url:"api_id"`
	AffiliateID string `json:"affiliate_id" url:"affiliate_id"`
	FloorID     string `json:"floor_id" url:"floor_id"`
	Initial     string `json:"initial,omitempty" url:"initial,omitempty"`
	Hits        int    `json:"hits" url:"hits,omitempty"`
	Offset      int    `json:"offset" url:"offset,omitempty"`
	Output      string `json:"output" url:"output,omitempty"`
	Callback    string `json:"callback,omitempty" url:"callback,omitempty"`
}

GenreOptions specifies the optional parameters to various List methods

func (*GenreOptions) GetHits

func (o *GenreOptions) GetHits() int

GetHits gets request hits parameter

func (*GenreOptions) GetOffset

func (o *GenreOptions) GetOffset() int

GetOffset gets request offset parameter

func (*GenreOptions) Next

func (o *GenreOptions) Next() (err error)

Next updates offset

type GenresService

type GenresService interface {
	First(context.Context, *GenreOptions) (Genre, *Response, error)
	List(context.Context, *GenreOptions) ([]Genre, *Response, error)
	Unmarshal(context.Context, *GenreOptions, interface{}) (*Response, error)
}

GenresService is an interface for interfacing with the Genre endpoints of the DMM Affiliate API See: https://affiliate.dmm.com/api/v3/genresearch.html

type GenresServiceOp

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

GenresServiceOp handles communication with the genre related methods of the DMM Affiliate API.

func (*GenresServiceOp) First

func (s *GenresServiceOp) First(ctx context.Context, opt *GenreOptions) (Genre, *Response, error)

First gets first genre

func (*GenresServiceOp) List

func (s *GenresServiceOp) List(ctx context.Context, opt *GenreOptions) ([]Genre, *Response, error)

List gets all genres

func (*GenresServiceOp) Unmarshal

func (s *GenresServiceOp) Unmarshal(ctx context.Context, opt *GenreOptions, out interface{}) (*Response, error)

Unmarshal parses genre API response

type ImageURL

type ImageURL struct {
	List  string `json:"list"`
	Small string `json:"small"`
	Large string `json:"large"`
}

ImageURL is image URLs for a product

type Item

type Item struct {
	AffiliateURL       string                     `json:"affiliateURL"`
	AffiliateURLMobile string                     `json:"affiliateURLsp"`
	BandaiInformation  BandaiInformation          `json:"bandaiinfo"`
	CategoryName       string                     `json:"category_name"`
	CdInformation      CdInformation              `json:"cdinfo"`
	Comment            string                     `json:"comment"`
	ContentID          string                     `json:"content_id"`
	Date               string                     `json:"date"`
	FloorCode          string                     `json:"floor_code"`
	FloorName          string                     `json:"floor_name"`
	ImageURL           ImageURL                   `json:"imageURL"`
	ISBN               string                     `json:"isbn,omitempty"`
	ItemInfo           map[string][]ItemComponent `json:"iteminfo"`
	JANCode            string                     `json:"jancode,omitempty"`
	MakerProduct       string                     `json:"maker_product"`
	Prices             Prices                     `json:"prices"`
	ProductID          string                     `json:"product_id"`
	Review             Review                     `json:"review"`
	SampleImageURL     SampleImage                `json:"sampleImageURL,omitempty"`
	SampleMovieURL     SampleMovie                `mapstructure:"sampleMovieURL"`
	ServiceCode        string                     `json:"service_code"`
	ServiceName        string                     `json:"service_name"`
	Stock              string                     `json:"stock"`
	Title              string                     `json:"title"`
	URL                string                     `json:"URL"`
	URLMobile          string                     `json:"URLsp"`
	Volume             string                     `json:"volume"`
}

Item represents a DMM product

type ItemComponent

type ItemComponent struct {
	ID   generic.String `json:"id"`
	Name string         `json:"name"`
}

ItemComponent is a product detail

type ItemOptions

type ItemOptions struct {
	APIID       string `json:"api_id" url:"api_id"`
	AffiliateID string `json:"affiliate_id" url:"affiliate_id"`
	Site        string `json:"site" url:"site"`
	Service     string `json:"service" url:"service,omitempty"`
	Floor       string `json:"floor" url:"floor,omitempty"`
	Sort        string `json:"sort" url:"sort,omitempty"`
	Keyword     string `json:"keyword" url:"keyword,omitempty"`
	ContentID   string `json:"cid" url:"cid,omitempty"`
	Article     string `json:"article" url:"article,omitempty"`
	ArticleID   string `json:"article_id" url:"article_id,omitempty"`
	GteDate     string `json:"gte_date" url:"gte_date,omitempty"`
	LteDate     string `json:"lte_date" url:"lte_date,omitempty"`
	Stock       string `json:"mono_stock" url:"mono_stock,omitempty"`
	Hits        int    `json:"hits" url:"hits,omitempty"`
	Offset      int    `json:"offset" url:"offset,omitempty"`
	Output      string `json:"output" url:"output,omitempty"`
	Callback    string `json:"callback,omitempty" url:"callback,omitempty"`
}

ItemOptions specifies the optional parameters to various List methods

func (*ItemOptions) GetHits

func (o *ItemOptions) GetHits() int

GetHits gets request hits parameter

func (*ItemOptions) GetOffset

func (o *ItemOptions) GetOffset() int

GetOffset gets request offset parameter

func (*ItemOptions) Next

func (o *ItemOptions) Next() (err error)

Next updates offset

type ItemsService

type ItemsService interface {
	First(context.Context, *ItemOptions) (Item, *Response, error)
	List(context.Context, *ItemOptions) ([]Item, *Response, error)
	Unmarshal(context.Context, *ItemOptions, interface{}) (*Response, error)
}

ItemsService is an interface for interfacing with the Item endpoints of the DMM Affiliate API See: https://affiliate.dmm.com/api/v3/itemlist.html

type ItemsServiceOp

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

ItemsServiceOp handles communication with the Item related methods of the DMM Affiliate API.

func (*ItemsServiceOp) First

func (s *ItemsServiceOp) First(ctx context.Context, opt *ItemOptions) (Item, *Response, error)

First gets first item

func (*ItemsServiceOp) List

func (s *ItemsServiceOp) List(ctx context.Context, opt *ItemOptions) ([]Item, *Response, error)

List gets all items

func (*ItemsServiceOp) Unmarshal

func (s *ItemsServiceOp) Unmarshal(ctx context.Context, opt *ItemOptions, out interface{}) (*Response, error)

Unmarshal parses item API response

type ListOptions

type ListOptions interface {
	Next() error
	GetOffset() int
	GetHits() int
}

ListOptions is interface that specifies the optional parameters to various List methods

type ListURL

type ListURL struct {
	Digital string `json:"digital"`
	Monthly string `json:"monthly"`
	PPM     string `json:"ppm"`
	Mono    string `json:"mono"`
	Rental  string `json:"rental"`
}

ListURL is list page URLs are specified actresses

type Maker

type Maker struct {
	MakerID     string `json:"maker_id"`
	Name        string `json:"name"`
	Ruby        string `json:"ruby"`
	ListURL     string `json:"list_url"`
	SiteName    string
	SiteCode    string
	ServiceName string
	ServiceCode string
	FloorID     string
	FloorName   string
	FloorCode   string
}

Maker represents a DMM maker

type MakerOptions

type MakerOptions struct {
	APIID       string `json:"api_id" url:"api_id"`
	AffiliateID string `json:"affiliate_id" url:"affiliate_id"`
	FloorID     string `json:"floor_id" url:"floor_id,omitempty"`
	Initial     string `json:"initial,omitempty" url:"initial,omitempty"`
	Hits        int    `json:"hits" url:"hits,omitempty"`
	Offset      int    `json:"offset" url:"offset,omitempty"`
	Output      string `json:"output" url:"output,omitempty"`
	Callback    string `json:"callback,omitempty" url:"callback,omitempty"`
}

MakerOptions specifies the optional parameters to various List methods

func (*MakerOptions) GetHits

func (o *MakerOptions) GetHits() int

GetHits gets request hits parameter

func (*MakerOptions) GetOffset

func (o *MakerOptions) GetOffset() int

GetOffset gets request offset parameter

func (*MakerOptions) Next

func (o *MakerOptions) Next() (err error)

Next updates offset

type MakersService

type MakersService interface {
	First(context.Context, *MakerOptions) (Maker, *Response, error)
	List(context.Context, *MakerOptions) ([]Maker, *Response, error)
	Unmarshal(context.Context, *MakerOptions, interface{}) (*Response, error)
}

MakersService is an interface for interfacing with the Maker endpoints of the DMM Affiliate API See: https://affiliate.dmm.com/api/v3/makersearch.html

type MakersServiceOp

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

MakersServiceOp handles communication with the Maker related methods of the DMM Affiliate API.

func (*MakersServiceOp) First

func (s *MakersServiceOp) First(ctx context.Context, opt *MakerOptions) (Maker, *Response, error)

First gets first maker

func (*MakersServiceOp) List

func (s *MakersServiceOp) List(ctx context.Context, opt *MakerOptions) ([]Maker, *Response, error)

List gets all makers

func (*MakersServiceOp) Unmarshal

func (s *MakersServiceOp) Unmarshal(ctx context.Context, opt *MakerOptions, out interface{}) (*Response, error)

Unmarshal parses maker API response

type Prices

type Prices struct {
	Price      string     `json:"price"`
	ListPrice  string     `json:"list_price"`
	Deliveries Deliveries `json:"deliveries"`
}

Prices is a price information

type Response

type Response struct {
	*http.Response
	Parameters ListOptions

	ResultCount   int
	TotalCount    int
	FirstPosition int
}

Response is a DMM API response. This wraps the standard http.Response returned from API.

func (*Response) IsLast

func (r *Response) IsLast() bool

IsLast returns true if the current request is the last

type Review

type Review struct {
	Count   int    `json:"count"`
	Average string `json:"average"`
}

Review is a review for a product

type SampleImage

type SampleImage struct {
	SampleS SampleImageURLs `json:"sample_s"`
}

SampleImage is a collection of sample image URL for a product

type SampleImageURLs

type SampleImageURLs struct {
	Image []string `json:"image"`
}

SampleImageURLs is sample image URLs for a product

type SampleMovie

type SampleMovie struct {
	Size476_306 string `json:"size_476_306"`
	Size560_360 string `json:"size_560_360"`
	Size644_414 string `json:"size_644_414"`
	Size720_480 string `json:"size_720_480"`
	PCFlag      int    `json:"pc_flag"`
	SPFlag      int    `json:"sp_flag"`
}

SampleMovie is sample movie URLs for a product

type Series

type Series struct {
	SeriesID    string `json:"series_id"`
	Name        string `json:"name"`
	Ruby        string `json:"ruby"`
	ListURL     string `json:"list_url"`
	SiteName    string
	SiteCode    string
	ServiceName string
	ServiceCode string
	FloorID     string
	FloorName   string
	FloorCode   string
}

Series represents a DMM series

type SeriesOptions

type SeriesOptions struct {
	APIID       string `json:"api_id" url:"api_id"`
	AffiliateID string `json:"affiliate_id" url:"affiliate_id"`
	FloorID     string `json:"floor_id" url:"floor_id,omitempty"`
	Initial     string `json:"initial,omitempty" url:"initial,omitempty"`
	Hits        int    `json:"hits" url:"hits,omitempty"`
	Offset      int    `json:"offset" url:"offset,omitempty"`
	Output      string `json:"output" url:"output,omitempty"`
	Callback    string `json:"callback,omitempty" url:"callback,omitempty"`
}

SeriesOptions specifies the optional parameters to various List methods

func (*SeriesOptions) GetHits

func (o *SeriesOptions) GetHits() int

GetHits gets request hits parameter

func (*SeriesOptions) GetOffset

func (o *SeriesOptions) GetOffset() int

GetOffset gets request offset parameter

func (*SeriesOptions) Next

func (o *SeriesOptions) Next() (err error)

Next updates offset

type SeriesService

type SeriesService interface {
	First(context.Context, *SeriesOptions) (Series, *Response, error)
	List(context.Context, *SeriesOptions) ([]Series, *Response, error)
	Unmarshal(context.Context, *SeriesOptions, interface{}) (*Response, error)
}

SeriesService is an interface for interfacing with the Serie endpoints of the DMM Affiliate API See: https://affiliate.dmm.com/api/v3/seriessearch.html

type SeriesServiceOp

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

SeriesServiceOp handles communication with the Series related methods of the DMM Affiliate API.

func (*SeriesServiceOp) First

First gets first series

func (*SeriesServiceOp) List

func (s *SeriesServiceOp) List(ctx context.Context, opt *SeriesOptions) ([]Series, *Response, error)

List gets all series

func (*SeriesServiceOp) Unmarshal

func (s *SeriesServiceOp) Unmarshal(ctx context.Context, opt *SeriesOptions, out interface{}) (*Response, error)

Unmarshal parses series API response

type Service

type Service struct {
	Name  string  `json:"name"`
	Code  string  `json:"code"`
	Floor []Floor `json:"floor"`
}

Service represents a DMM service

type Site

type Site struct {
	Name     string    `json:"name"`
	Code     string    `json:"code"`
	Services []Service `json:"service"`
}

Site represents a DMM site

Jump to

Keyboard shortcuts

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