Documentation
¶
Index ¶
- func GeneratePKCEPair() (verifier, challenge string, err error)
- func ParseUID(raw string) (int64, error)
- func RandomURLToken(size int) (string, error)
- func ResolveRefreshToken(store auth.AuthStore, requestedUserID int64, requestedToken string, ...) (string, error)
- type AccountAddRequest
- type AccountCheckRequest
- type AccountListResult
- type AccountResult
- type AccountService
- func (s AccountService) Add(ctx context.Context, req AccountAddRequest) (AccountResult, error)
- func (s AccountService) Check(ctx context.Context, userID int64) (AccountResult, error)
- func (s AccountService) CheckWithRequest(ctx context.Context, req AccountCheckRequest) (AccountResult, error)
- func (s AccountService) List() (AccountListResult, error)
- func (s AccountService) Remove(userID int64) (AccountResult, int64, error)
- func (s AccountService) Use(userID int64) (int64, error)
- type ArtworkClient
- type ArtworkService
- func (s ArtworkService) Detail(ctx context.Context, clientReq ClientRequest, id int64) (*pixiv.IllustDetail, bool, error)
- func (s ArtworkService) Ranking(ctx context.Context, req RankingRequest) (*pixiv.IllustList, bool, error)
- func (s ArtworkService) Recommended(ctx context.Context, req RecommendedRequest) (*pixiv.IllustList, bool, error)
- func (s ArtworkService) Search(ctx context.Context, req SearchRequest) (*pixiv.IllustList, bool, error)
- type AuthRepository
- type AuthenticatedPixivClient
- type AuthenticatedPixivFactory
- type ClientBundle
- type ClientRequest
- type ClientResolver
- type ClientSession
- type ConfigMutationResult
- type ConfigService
- type ConfigStore
- type DownloadClient
- type DownloadFactory
- type DownloadService
- type Downloader
- type LoginCompleteRequest
- type LoginService
- type LoginStart
- type OAuthClientFactory
- type OAuthExchanger
- type OAuthToken
- type PixivClientFactory
- type RankingRequest
- type RecommendedRequest
- type SearchRequest
- type Services
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GeneratePKCEPair ¶
func RandomURLToken ¶
Types ¶
type AccountAddRequest ¶
type AccountCheckRequest ¶
type AccountListResult ¶
type AccountListResult struct {
DefaultUserID int64
Accounts []AccountResult
}
type AccountResult ¶
type AccountService ¶
type AccountService struct {
Auth AuthRepository
LoadRuntime func() (config.RuntimeConfig, error)
RefreshTokenEnv func() string
NewClient AuthenticatedPixivFactory
}
func (AccountService) Add ¶
func (s AccountService) Add(ctx context.Context, req AccountAddRequest) (AccountResult, error)
func (AccountService) Check ¶
func (s AccountService) Check(ctx context.Context, userID int64) (AccountResult, error)
func (AccountService) CheckWithRequest ¶
func (s AccountService) CheckWithRequest(ctx context.Context, req AccountCheckRequest) (AccountResult, error)
func (AccountService) List ¶
func (s AccountService) List() (AccountListResult, error)
func (AccountService) Remove ¶
func (s AccountService) Remove(userID int64) (AccountResult, int64, error)
type ArtworkClient ¶
type ArtworkClient interface {
SearchIllust(context.Context, string, string, string, string, int) (*pixiv.IllustList, error)
IllustDetail(context.Context, int64) (*pixiv.IllustDetail, error)
IllustRanking(context.Context, string, string, int) (*pixiv.IllustList, error)
IllustRecommended(context.Context, int) (*pixiv.IllustList, error)
}
type ArtworkService ¶
type ArtworkService struct {
Resolver ClientResolver
}
func (ArtworkService) Detail ¶
func (s ArtworkService) Detail(ctx context.Context, clientReq ClientRequest, id int64) (*pixiv.IllustDetail, bool, error)
func (ArtworkService) Ranking ¶
func (s ArtworkService) Ranking(ctx context.Context, req RankingRequest) (*pixiv.IllustList, bool, error)
func (ArtworkService) Recommended ¶
func (s ArtworkService) Recommended(ctx context.Context, req RecommendedRequest) (*pixiv.IllustList, bool, error)
func (ArtworkService) Search ¶
func (s ArtworkService) Search(ctx context.Context, req SearchRequest) (*pixiv.IllustList, bool, error)
type AuthRepository ¶
type AuthenticatedPixivFactory ¶
type AuthenticatedPixivFactory func(config.RuntimeConfig) (AuthenticatedPixivClient, error)
type ClientBundle ¶
type ClientBundle struct {
Auth AuthenticatedPixivClient
Artwork ArtworkClient
Download DownloadClient
}
type ClientRequest ¶
type ClientResolver ¶
type ClientResolver struct {
Auth AuthRepository
LoadRuntime func() (config.RuntimeConfig, error)
RefreshTokenEnv func() string
NewClient PixivClientFactory
}
func (ClientResolver) Resolve ¶
func (r ClientResolver) Resolve(ctx context.Context, req ClientRequest) (ClientSession, error)
type ClientSession ¶
type ClientSession struct {
Client ClientBundle
Config config.RuntimeConfig
JSONOut bool
}
type ConfigMutationResult ¶
type ConfigService ¶
type ConfigService struct {
Store ConfigStore
}
func (ConfigService) Get ¶
func (s ConfigService) Get(alias string) (config.SettingValue, error)
func (ConfigService) Path ¶
func (s ConfigService) Path() (string, error)
func (ConfigService) Set ¶
func (s ConfigService) Set(alias, raw string) (ConfigMutationResult, error)
func (ConfigService) Unset ¶
func (s ConfigService) Unset(alias string) (ConfigMutationResult, error)
type ConfigStore ¶
type ConfigStore interface {
Path() (string, error)
Get(string) (config.SettingValue, error)
Set(string, string) (ConfigMutationResult, error)
Unset(string) (ConfigMutationResult, error)
}
type DownloadClient ¶
type DownloadClient interface {
download.PixivClient
}
type DownloadFactory ¶
type DownloadFactory func(DownloadClient, config.RuntimeConfig) Downloader
type DownloadService ¶
type DownloadService struct {
Resolver ClientResolver
NewDownloader DownloadFactory
}
func (DownloadService) Download ¶
func (s DownloadService) Download(ctx context.Context, clientReq ClientRequest, ids []int64) ([]download.DownloadedArtwork, bool, error)
type Downloader ¶
type LoginCompleteRequest ¶
type LoginService ¶
type LoginService struct {
Auth AuthRepository
LoadRuntime func() (config.RuntimeConfig, error)
NewOAuth OAuthClientFactory
}
func (LoginService) Complete ¶
func (s LoginService) Complete(ctx context.Context, req LoginCompleteRequest) (AccountResult, error)
func (LoginService) Start ¶
func (s LoginService) Start() (LoginStart, error)
type LoginStart ¶
type OAuthClientFactory ¶
type OAuthClientFactory func(config.RuntimeConfig, string) (OAuthExchanger, error)
type OAuthExchanger ¶
type OAuthToken ¶
type PixivClientFactory ¶
type PixivClientFactory func(config.RuntimeConfig) (ClientBundle, error)
type RankingRequest ¶
type RankingRequest struct {
Client ClientRequest
Mode string
Date string
Offset int
}
type RecommendedRequest ¶
type RecommendedRequest struct {
Client ClientRequest
Offset int
}
type SearchRequest ¶
type Services ¶
type Services struct {
Account AccountService
Config ConfigService
Artwork ArtworkService
Download DownloadService
Login LoginService
}
Click to show internal directories.
Click to hide internal directories.