pkg

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigDirname  = ".config/typora-qiniu-uploader"
	ConfigFilename = "config.json"
)

Variables

This section is empty.

Functions

func InitOrGetLogger added in v1.1.0

func InitOrGetLogger() *log.Logger

func PathExists

func PathExists(path string) bool

PathExists check if a path exists

Types

type Config

type Config struct {
	AccessKey     string `json:"access_key"`
	SecretKey     string `json:"secret_key"`
	Bucket        string `json:"Bucket"`
	UseHTTPS      bool   `json:"use_https"`
	UseCdnDomains bool   `json:"use_cdn_domains"`
	Domain        string `json:"domain"`
	SubDir        string `json:"sub_dir"`
}

func LoadConfig

func LoadConfig(path string) (config *Config)

func NewConfig

func NewConfig() *Config

NewConfig generate an empty config

type QiNiuClient

type QiNiuClient struct {
	AccessKey     string `json:"access_key"`
	SecretKey     string `json:"secret_key"`
	Bucket        string `json:"bucket"`
	UseHTTPS      bool   `json:"use_https"`
	UseCdnDomains bool   `json:"use_cdn_domains"`
	Domain        string `json:"domain"`
	Subdir        string `json:"subdir"`
}

func NewQiNiuClient

func NewQiNiuClient(accessKey, secretKey, bucket string, useHttps, useCdnDomains bool, domain, subdir string) *QiNiuClient

func (*QiNiuClient) UploadImages

func (q *QiNiuClient) UploadImages(images []string) (urls []string)

Jump to

Keyboard shortcuts

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