chuangcache

package
v0.0.0-...-075a06a Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApiEndpoint = "https://api.chuangcache.com"
	StatusOk    = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BindReq

type BindReq struct {
	Request

	Id     string `json:"ssl_key,omitempty"`
	Domain string `json:"domain_id,omitempty"`
}

func (*BindReq) Token

func (br *BindReq) Token(token string) (req core.TokenSetter)

type Certificate

type Certificate struct {
	Title  string            `json:"Title,omitempty"`
	Key    string            `json:"CertKey,omitempty"`
	Status CertificateStatus `json:"Status,omitempty"`
}

type CertificateStatus

type CertificateStatus string
const CertificateStatusInuse CertificateStatus = "InUse"

type DeleteReq

type DeleteReq struct {
	Request

	Key string `json:"ssl_key,omitempty"`
}

type Domain

type Domain struct {
	Id   string `json:"domain_id"`
	Name string `json:"domain_name"`
}

type ListReq

type ListReq struct {
	RequestV2

	PageSize int
	PageNo   int
}

func (*ListReq) Token

func (lr *ListReq) Token(token string) (req core.TokenSetter)

type ListRsp

type ListRsp struct {
	Certificates []*Certificate `json:"DataSet,omitempty"`
	Total        int
	Page         int
	Size         int
}

type Request

type Request struct {
	AccessToken string `json:"access_token"`
}

func (*Request) Token

func (r *Request) Token(token string) (req core.TokenSetter)

type RequestV2

type RequestV2 struct {
	AccessToken string
}

func (*RequestV2) Token

func (r *RequestV2) Token(token string) (req core.TokenSetter)

type Response

type Response[T any] struct {
	// 接口返回码
	// 0:操作失败
	// 1:操作成功
	Status int `json:"status"`
	// 接口返回信息
	Info string `json:"info"`
	// 数据
	Data T `json:"data"`
}

func (*Response[T]) Code

func (cr *Response[T]) Code() int

func (*Response[T]) Message

func (cr *Response[T]) Message() string

type TokenReq

type TokenReq struct {
	// 授权,类似于用户名
	Ak string `json:"ak"`
	// 授权,类似于密码
	Sk string `json:"sk"`
}

TokenReq 刷新请求

type TokenRsp

type TokenRsp struct {
	// 用户授权的唯一票据,用于调用接口的唯一票据
	AccessToken string `json:"access_token"`
	//  AccessToken的生命周期,单位是秒数
	ExpiresIn int `json:"expires_in,string"`
}

TokenRsp 刷新响应

type UploadReq

type UploadReq struct {
	Request

	Title       string `json:"ssl_title,omitempty"`
	Private     string `json:"private_key,omitempty"`
	Certificate string `json:"certificate,omitempty"`
}

func (*UploadReq) Chain

func (ur *UploadReq) Chain(chain string)

func (*UploadReq) Key

func (ur *UploadReq) Key(key string)

func (*UploadReq) Token

func (ur *UploadReq) Token(token string) (req core.TokenSetter)

type UploadRsp

type UploadRsp struct {
	Id string `json:"ssl_key,omitempty"`
}

Jump to

Keyboard shortcuts

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