cloud

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GiteeOpts

type GiteeOpts struct {
	RepoName     string `json:"repoName" yaml:"repoName"`
	Branch       string `json:"branch" yaml:"branch"`
	Path         string `json:"path" yaml:"path"`
	Email        string `json:"email" yaml:"email"`
	Password     string `json:"password" yaml:"password"`
	ClientID     string `json:"clientId" yaml:"clientId"`
	ClientSecret string `json:"clientSecret" yaml:"clientSecret"`
	AccessToken  string `json:"accessToken" yaml:"accessToken"`
}

api: https://gitee.com/api/v5/swagger#/postV5ReposOwnerRepoContentsPath

func (*GiteeOpts) Parse

func (g *GiteeOpts) Parse(str string) string

func (*GiteeOpts) URL

func (g *GiteeOpts) URL() string

func (*GiteeOpts) Upload

func (g *GiteeOpts) Upload(fileName string, data []byte) (string, error)

POST https://gitee.com/api/v5/repos/{owner}/{repo}/contents/{path}

type GithubOpts

type GithubOpts struct {
	RepoName string `json:"repoName" yaml:"repoName"` // the name of warehouse, like: betterfor/gopic
	Branch   string `json:"branch" yaml:"branch"`     // project branch, default is master
	Token    string `json:"token" yaml:"token"`       // set github personal access tokens
	Path     string `json:"path" yaml:"path"`         // storage path in github, support variables ${time-format}, default is images
}

https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#create-or-update-file-contents github options

func (*GithubOpts) Parse

func (g *GithubOpts) Parse(str string) string

func (*GithubOpts) String

func (g *GithubOpts) String() string

func (*GithubOpts) URL

func (g *GithubOpts) URL() string

func (*GithubOpts) Unmarshal

func (g *GithubOpts) Unmarshal(opts []byte) *GithubOpts

func (*GithubOpts) Upload

func (g *GithubOpts) Upload(fileName string, data []byte) (string, error)

PUT /repos/{owner}/{repo}/contents/{path}

type SmmsOpts

type SmmsOpts struct {
	Token string `json:"token"`
}

https://doc.sm.ms/#api-Image-Upload smms options

func (*SmmsOpts) Parse

func (s *SmmsOpts) Parse(str string) string

func (*SmmsOpts) URL

func (s *SmmsOpts) URL() string

func (*SmmsOpts) Upload

func (s *SmmsOpts) Upload(fileName string, data []byte) (string, error)

type TokenResponse

type TokenResponse struct {
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int64  `json:"expires_in"`
	RefreshToken string `json:"refresh_token"`
	Scope        string `json:"scope"`
	CreatedAt    int64  `json:"created_at"`
}

Jump to

Keyboard shortcuts

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