baidu

package module
v0.0.0-...-d044151 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: MIT Imports: 9 Imported by: 0

README

baidu

百度AI https://ai.baidu.com

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RenewLocker

type RenewLocker interface {
	Acquire(key string, ttl time.Duration) (bool, error)
	Release(key string) error
}

RenewLocker TOKEN刷新锁 在刷新TOKEN之前申请许可, 通过后方可刷新TOKEN

type SDK

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

func New

func New(apiKey, secretKey string, storage TokenStorage) *SDK

func (*SDK) Face

func (sdk *SDK) Face() face.SDK

func (*SDK) Ocr

func (sdk *SDK) Ocr() ocr.SDK

func (*SDK) Rni

func (sdk *SDK) Rni() rni.SDK

type TokenStorage

type TokenStorage interface {
	Store(key, value string, ttl time.Duration) error
	Fetch(key string) (string, error)
}

TokenStorage TOKEN持久化

func RedisStorage

func RedisStorage(client *redigo.Client) TokenStorage

Directories

Path Synopsis
pkg
ocr
rni

Jump to

Keyboard shortcuts

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