Categorygithub.com/sapuri/avgle-go
modulepackage
0.0.0-20200610032626-f783f76e3ffb
Repository: https://github.com/sapuri/avgle-go.git
Documentation: pkg.go.dev

# README

avgle-go

The unofficial Go client for Avgle API

API Reference: https://avgle.github.io/doc/

Installation

go get github.com/sapuri/avgle-go

Usage

Methods

type Client interface {
	GetCategories(ctx context.Context) (GetCategoriesResp, error)
	GetCollections(ctx context.Context, page, limit string) (GetCollectionsResp, error)
	GetVideos(ctx context.Context, page string) (GetVideosResp, error)
	SearchVideos(ctx context.Context, query, page string) (SearchVideosResp, error)
	SearchJAVs(ctx context.Context, query, page string) (SearchJAVsResp, error)
	GetVideoByVID(ctx context.Context, vid string) (GetVideoByVIDResp, error)
}

Example

package main

import (
	"context"
	"fmt"
	"log"

	"github.com/sapuri/avgle-go"
)

func main() {
	ctx := context.Background()

	client, err := avgle.NewClient()
	if err != nil {
		log.Fatal(err)
	}

	result, err := client.SearchVideos(ctx, "三上悠亜", "0")
	if err != nil {
		log.Fatal(err)
	}

	videos := result.Response.Videos
	for _, video := range videos {
		fmt.Println(video)
	}
}

License

Apache License 2.0

# Functions

NewClient returns a new Client.
WithBaseURL sets baseURL as ClientOption.
WithHTTPClient sets httpClient as ClientOption.

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author

# Type aliases

ClientOption represents options func.
No description provided by the author
No description provided by the author