config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package config Configuration information of the DouYin Open Platform

Index

Constants

View Source
const (
	// AccessTokenKey AccessToken Key
	AccessTokenKey = "accessTokenKey"
)
View Source
const (
	// CacheKeyPrefix 抖音 open cache key 前缀
	CacheKeyPrefix = "bytedance_douyin_lite"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

Config 抖音开放平台的配置信息

func New

func New(ctx context.Context, opts ...Option) *Config

New create config

func NewConfig

func NewConfig(ctx context.Context, clientKey, clientSecret, redirectURL, scopes, salt, token string) *Config

NewConfig new config

func (*Config) Cache

func (cfg *Config) Cache() cache.Cache

Cache 获取 cache

func (*Config) CacheKeyPrefix added in v0.0.7

func (cfg *Config) CacheKeyPrefix() string

CacheKeyPrefix 获取 cacheKeyPrefix

func (*Config) ClientKey

func (cfg *Config) ClientKey() string

ClientKey 获取 clientKey

func (*Config) ClientSecret

func (cfg *Config) ClientSecret() string

ClientSecret 获取 clientSecret

func (*Config) KeyType added in v0.1.0

func (cfg *Config) KeyType() Secret

KeyType 获取 keyType

func (*Config) KeyVersion added in v0.0.9

func (cfg *Config) KeyVersion() int

KeyVersion 获取 keyVersion

func (*Config) Logger

func (cfg *Config) Logger() logger.ILogger

Logger 获取 logger

func (*Config) PrivateKey added in v0.0.9

func (cfg *Config) PrivateKey() string

PrivateKey 获取 privateKey

func (*Config) PublicKey added in v0.0.9

func (cfg *Config) PublicKey() string

PublicKey 获取 publicKey

func (*Config) RedirectURL

func (cfg *Config) RedirectURL() string

RedirectURL 获取 redirectURL

func (*Config) Request

func (cfg *Config) Request() request.Request

Request 获取 request

func (*Config) Salt

func (cfg *Config) Salt() string

Salt 获取 salt

func (*Config) Scopes

func (cfg *Config) Scopes() string

Scopes 获取 scopes

func (*Config) SetCache

func (cfg *Config) SetCache(cache cache.Cache) *Config

SetCache 设置缓存

func (*Config) SetCacheKeyPrefix added in v0.0.7

func (cfg *Config) SetCacheKeyPrefix(cacheKeyPrefix string) *Config

SetCacheKeyPrefix 设置 cacheKeyPrefix

func (*Config) SetClientKey

func (cfg *Config) SetClientKey(clientKey string) *Config

SetClientKey 设置 clientKey

func (*Config) SetClientSecret

func (cfg *Config) SetClientSecret(clientSecret string) *Config

SetClientSecret 设置 clientSecret

func (*Config) SetKeyType added in v0.1.0

func (cfg *Config) SetKeyType(keyType Secret) *Config

SetKeyType 设置 keyType

func (*Config) SetKeyVersion added in v0.0.9

func (cfg *Config) SetKeyVersion(keyVersion int) *Config

SetKeyVersion 设置 keyVersion

func (*Config) SetLogger

func (cfg *Config) SetLogger(logger logger.ILogger) *Config

SetLogger 设置日志

func (*Config) SetPrivateKey added in v0.0.9

func (cfg *Config) SetPrivateKey(privateKey string) *Config

SetPrivateKey 设置 privateKey

func (*Config) SetPublicKey added in v0.0.9

func (cfg *Config) SetPublicKey(publicKey string) *Config

SetPublicKey 设置 publicKey

func (*Config) SetRedirectURL

func (cfg *Config) SetRedirectURL(redirectURL string) *Config

SetRedirectURL 设置 redirectURL

func (*Config) SetRequest

func (cfg *Config) SetRequest(request request.Request) *Config

SetRequest 设置请求

func (*Config) SetSalt

func (cfg *Config) SetSalt(salt string) *Config

SetSalt 设置 salt

func (*Config) SetScopes

func (cfg *Config) SetScopes(scopes string) *Config

SetScopes 设置 scopes

func (*Config) SetToken added in v0.0.6

func (cfg *Config) SetToken(token string) *Config

SetToken 设置 token

func (*Config) SetVersion added in v0.0.8

func (cfg *Config) SetVersion(version string) *Config

SetVersion 设置 version

func (*Config) Token added in v0.0.6

func (cfg *Config) Token() string

Token 获取 token

func (*Config) Version added in v0.0.8

func (cfg *Config) Version() string

Version 获取 version

type Option

type Option func(*options)

Option micro app option

func WithCache added in v0.0.4

func WithCache(cache cache.Cache) Option

WithCache set cache

func WithCacheKeyPrefix added in v0.0.7

func WithCacheKeyPrefix(cacheKeyPrefix string) Option

WithCacheKeyPrefix set cacheKeyPrefix

func WithClientKey

func WithClientKey(clientKey string) Option

WithClientKey set clientKey

func WithClientSecret

func WithClientSecret(clientSecret string) Option

WithClientSecret set clientSecret

func WithKeyType added in v0.1.0

func WithKeyType(keyType Secret) Option

WithKeyType set keyType

func WithKeyVersion added in v0.0.9

func WithKeyVersion(keyVersion int) Option

WithKeyVersion set keyVersion

func WithLogger

func WithLogger(logger logger.ILogger) Option

WithLogger set logger

func WithPrivateKey added in v0.0.9

func WithPrivateKey(privateKey string) Option

WithPrivateKey set privateKey

func WithPublicKey added in v0.0.9

func WithPublicKey(publicKey string) Option

WithPublicKey set publicKey

func WithRedirectURL

func WithRedirectURL(redirectURL string) Option

WithRedirectURL set redirectURL

func WithRequest

func WithRequest(request request.Request) Option

WithRequest set request

func WithSalt

func WithSalt(salt string) Option

WithSalt set salt

func WithScopes

func WithScopes(scopes string) Option

WithScopes set scopes

func WithToken added in v0.0.6

func WithToken(token string) Option

WithToken set token

type Secret added in v0.1.0

type Secret uint

Secret defines the private key type

const (
	PKCS1 Secret = iota
	PKCS8
)

Jump to

Keyboard shortcuts

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