Versions in this module Expand all Collapse all v0 v0.2.0 Aug 16, 2026 Changes in this version + const ProxySourceConfig + const ProxySourceFlag + func ConfigKeys() []string + func ConfigPath() (string, error) + func FilenameTemplatePlaceholders() []string + func IsKnownConfigKey(key string) bool + func ParseProxyURL(raw string) (*url.URL, error) + func SetConfigKey(key, value string) error + type Config struct + DownloadDir string + FilenameTemplate string + Level int + Output string + Proxy string + Workers int + func DefaultConfig() Config + func LoadConfig() (Config, error) + func LoadConfigWithSet() (Config, map[string]bool, error) type Kit + Config Config + ProxySource string + ProxyURL *url.URL + func (k *Kit) HTTPClient() *http.Client + func (k *Kit) UseProxy(u *url.URL, source string) + func (k *Kit) WantJSON() bool v0.1.0 Jul 27, 2026 Changes in this version + const RpcsAnnotationKey + var ErrCancelled = errors.New("用户已取消") + var ErrNotLogin = errors.New("未登录") + var ErrUsage = errors.New("用法错误") + func AnnotateRpcs(c *cobra.Command, rpcs ...string) + func ConfigDir() (string, error) + func Exec[Req, Resp any](k *Kit, ctx context.Context, ep *engine.Endpoint[Req, Resp], req Req) (Resp, error) + func HistoryPath() (string, error) + func MaskCookie(cookie string) string + func MountCompletion(root *cobra.Command, k *Kit) + func ParseRpcs(s string) []string + func PrintJSON(msg proto.Message) error + func PrintRaw(raw json.RawMessage) + func RenderBar(current, total int64, width int, color bool) string + func RenderExec[Req any, Resp proto.Message](k *Kit, ep *engine.Endpoint[Req, Resp], req Req) error + func RenderHuman(msg proto.Message) string + func ResolveID(flagID int64, args []string) (int64, error) + func ResolveKeyword(flagKeyword string, args []string) (string, error) + func SessionPath() (string, error) + type Bar struct + Current int64 + IsTotal bool + Label string + State BarState + Total int64 + func (b *Bar) Complete(now time.Time) + func (b *Bar) Fail(msg string, now time.Time) + func (b *Bar) Incr(n int64, now time.Time) + type BarState int + const StateActive + const StateDone + const StateFailed + const StateWaiting + type Kit struct + Err io.Writer + JSON bool + Out io.Writer + Yes bool + func New() *Kit + func (k *Kit) ClearSession() error + func (k *Kit) ConfirmFatal(action string) error + func (k *Kit) ConfirmWrite(action string) (bool, error) + func (k *Kit) CookieCtx() context.Context + func (k *Kit) CurrentCookie() string + func (k *Kit) HumanOutput() bool + func (k *Kit) LoadSession() (Session, error) + func (k *Kit) NewProgress() *Progress + func (k *Kit) NewSpinner(label string, opts ...SpinnerOption) *Spinner + func (k *Kit) OutWriter() io.Writer + func (k *Kit) RawDo(ctx context.Context, meta engine.Meta, params map[string]any) (json.RawMessage, string, error) + func (k *Kit) RecallPool() *recall.Pool + func (k *Kit) Record(id int64, name, artist string, src recall.Src) + func (k *Kit) Render(msg proto.Message) error + func (k *Kit) RequireLogin() error + func (k *Kit) SaveSession(sess Session) error + func (k *Kit) SetRecallPool(p *recall.Pool) + func (k *Kit) Warnf(format string, args ...any) + type Progress struct + func NewProgress(out io.Writer, width int, tty bool, opts ...ProgressOption) *Progress + func (p *Progress) AddBar(total int64, label string) *Bar + func (p *Progress) Now() time.Time + func (p *Progress) RenderForTest() + func (p *Progress) SetWidth(width int) + func (p *Progress) Start() + func (p *Progress) Wait() + type ProgressOption func(*Progress) + func WithProgressClock(now func() time.Time) ProgressOption + func WithProgressColor(c bool) ProgressOption + func WithProgressWidthSource(f func() int) ProgressOption + type Session struct + Cookie string + SavedAt string + UserID int64 + type Spinner struct + func NewSpinner(out io.Writer, label string, tty bool, opts ...SpinnerOption) *Spinner + func (s *Spinner) Start() + func (s *Spinner) Stop(msg string) + type SpinnerOption func(*Spinner) + func WithSpinnerClock(now func() time.Time) SpinnerOption + func WithSpinnerLabelFunc(fn func() string) SpinnerOption