v2

package
v0.4.28 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

A simple SDK client for 1Panel v2. API documentation: https://1panel.cn/docs/v2/dev_manual/api_manual/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(serverUrl string, optFns ...OptionsFunc) (*Client, error)

func (*Client) CoreSettingsSSLUpdate added in v0.4.6

func (c *Client) CoreSettingsSSLUpdate(req *CoreSettingsSSLUpdateRequest) (*CoreSettingsSSLUpdateResponse, error)

func (*Client) CoreSettingsSSLUpdateWithContext added in v0.4.6

func (c *Client) CoreSettingsSSLUpdateWithContext(ctx context.Context, req *CoreSettingsSSLUpdateRequest) (*CoreSettingsSSLUpdateResponse, error)

func (*Client) SetTLSConfig

func (c *Client) SetTLSConfig(config *tls.Config) *Client

func (*Client) SetTimeout

func (c *Client) SetTimeout(timeout time.Duration) *Client

func (*Client) WebsiteGet added in v0.4.6

func (c *Client) WebsiteGet(websiteId int64) (*WebsiteGetResponse, error)

func (*Client) WebsiteGetWithContext added in v0.4.6

func (c *Client) WebsiteGetWithContext(ctx context.Context, websiteId int64) (*WebsiteGetResponse, error)

func (*Client) WebsiteHttpsGet added in v0.4.6

func (c *Client) WebsiteHttpsGet(websiteId int64) (*WebsiteHttpsGetResponse, error)

func (*Client) WebsiteHttpsGetWithContext added in v0.4.6

func (c *Client) WebsiteHttpsGetWithContext(ctx context.Context, websiteId int64) (*WebsiteHttpsGetResponse, error)

func (*Client) WebsiteHttpsPost added in v0.4.6

func (c *Client) WebsiteHttpsPost(websiteId int64, req *WebsiteHttpsPostRequest) (*WebsiteHttpsPostResponse, error)

func (*Client) WebsiteHttpsPostWithContext added in v0.4.19

func (c *Client) WebsiteHttpsPostWithContext(ctx context.Context, websiteId int64, req *WebsiteHttpsPostRequest) (*WebsiteHttpsPostResponse, error)

func (*Client) WebsiteSSLSearch added in v0.4.6

func (c *Client) WebsiteSSLSearch(req *WebsiteSSLSearchRequest) (*WebsiteSSLSearchResponse, error)

func (*Client) WebsiteSSLSearchWithContext added in v0.4.6

func (c *Client) WebsiteSSLSearchWithContext(ctx context.Context, req *WebsiteSSLSearchRequest) (*WebsiteSSLSearchResponse, error)

func (*Client) WebsiteSSLUpload added in v0.4.6

func (c *Client) WebsiteSSLUpload(req *WebsiteSSLUploadRequest) (*WebsiteSSLUploadResponse, error)

func (*Client) WebsiteSSLUploadWithContext added in v0.4.6

func (c *Client) WebsiteSSLUploadWithContext(ctx context.Context, req *WebsiteSSLUploadRequest) (*WebsiteSSLUploadResponse, error)

func (*Client) WebsiteSearch added in v0.4.6

func (c *Client) WebsiteSearch(req *WebsiteSearchRequest) (*WebsiteSearchResponse, error)

func (*Client) WebsiteSearchWithContext added in v0.4.6

func (c *Client) WebsiteSearchWithContext(ctx context.Context, req *WebsiteSearchRequest) (*WebsiteSearchResponse, error)

type CoreSettingsSSLUpdateRequest added in v0.4.6

type CoreSettingsSSLUpdateRequest struct {
	Cert        string `json:"cert"`
	Key         string `json:"key"`
	SSLType     string `json:"sslType"`
	SSL         string `json:"ssl"`
	SSLID       int64  `json:"sslID"`
	AutoRestart string `json:"autoRestart"`
}

type CoreSettingsSSLUpdateResponse added in v0.4.6

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

func (*CoreSettingsSSLUpdateResponse) GetCode added in v0.4.6

func (r *CoreSettingsSSLUpdateResponse) GetCode() int

func (*CoreSettingsSSLUpdateResponse) GetMessage added in v0.4.6

func (r *CoreSettingsSSLUpdateResponse) GetMessage() string

type Options added in v0.4.25

type Options struct {
	ApiKey      string
	CurrentNode string
}

type OptionsFunc added in v0.4.25

type OptionsFunc func(*Options)

func WithApiKey added in v0.4.25

func WithApiKey(apiKey string) OptionsFunc

func WithNode added in v0.4.25

func WithNode(node string) OptionsFunc

type SSLCertificate added in v0.4.26

type SSLCertificate v1.SSLCertificate

type Website added in v0.4.26

type Website v1.Website

type WebsiteDetail added in v0.4.26

type WebsiteDetail struct {
	Website
	Domains []*WebsiteDomainConfig `json:"domains"`
}

type WebsiteDomainConfig added in v0.4.26

type WebsiteDomainConfig v1.WebsiteDomainConfig

type WebsiteGetRequest added in v0.4.6

type WebsiteGetRequest struct {
	Name     string `json:"name"`
	Type     string `json:"type"`
	Page     int32  `json:"page"`
	PageSize int32  `json:"pageSize"`
}

type WebsiteGetResponse added in v0.4.6

type WebsiteGetResponse struct {
	Data *WebsiteDetail `json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*WebsiteGetResponse) GetCode added in v0.4.6

func (r *WebsiteGetResponse) GetCode() int

func (*WebsiteGetResponse) GetMessage added in v0.4.6

func (r *WebsiteGetResponse) GetMessage() string

type WebsiteHTTPSConfig added in v0.4.26

type WebsiteHTTPSConfig struct {
	v1.WebsiteHTTPSConfig
	Http3 bool `json:"http3"`
}

type WebsiteHttpsGetResponse added in v0.4.6

type WebsiteHttpsGetResponse struct {
	Data *WebsiteHTTPSConfig `json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*WebsiteHttpsGetResponse) GetCode added in v0.4.6

func (r *WebsiteHttpsGetResponse) GetCode() int

func (*WebsiteHttpsGetResponse) GetMessage added in v0.4.6

func (r *WebsiteHttpsGetResponse) GetMessage() string

type WebsiteHttpsPostRequest added in v0.4.6

type WebsiteHttpsPostRequest struct {
	WebsiteID    int64    `json:"websiteId"`
	Enable       bool     `json:"enable"`
	Type         string   `json:"type"`
	WebsiteSSLID int64    `json:"websiteSSLId"`
	HttpConfig   string   `json:"httpConfig"`
	SSLProtocol  []string `json:"SSLProtocol"`
	Algorithm    string   `json:"algorithm"`
	Hsts         bool     `json:"hsts"`
	Http3        bool     `json:"http3"`
}

type WebsiteHttpsPostResponse added in v0.4.6

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

func (*WebsiteHttpsPostResponse) GetCode added in v0.4.6

func (r *WebsiteHttpsPostResponse) GetCode() int

func (*WebsiteHttpsPostResponse) GetMessage added in v0.4.6

func (r *WebsiteHttpsPostResponse) GetMessage() string

type WebsiteSSLSearchRequest added in v0.4.6

type WebsiteSSLSearchRequest struct {
	Domain   string `json:"domain"`
	Order    string `json:"order"`
	OrderBy  string `json:"orderBy"`
	Page     int32  `json:"page"`
	PageSize int32  `json:"pageSize"`
}

type WebsiteSSLSearchResponse added in v0.4.6

type WebsiteSSLSearchResponse struct {
	Data *struct {
		Items []*SSLCertificate `json:"items"`
		Total int32             `json:"total"`
	} `json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*WebsiteSSLSearchResponse) GetCode added in v0.4.6

func (r *WebsiteSSLSearchResponse) GetCode() int

func (*WebsiteSSLSearchResponse) GetMessage added in v0.4.6

func (r *WebsiteSSLSearchResponse) GetMessage() string

type WebsiteSSLUploadRequest added in v0.4.6

type WebsiteSSLUploadRequest struct {
	SSLID           int64  `json:"sslID"`
	Type            string `json:"type"`
	Certificate     string `json:"certificate"`
	CertificatePath string `json:"certificatePath"`
	PrivateKey      string `json:"privateKey"`
	PrivateKeyPath  string `json:"privateKeyPath"`
	Description     string `json:"description"`
}

type WebsiteSSLUploadResponse added in v0.4.6

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

func (*WebsiteSSLUploadResponse) GetCode added in v0.4.6

func (r *WebsiteSSLUploadResponse) GetCode() int

func (*WebsiteSSLUploadResponse) GetMessage added in v0.4.6

func (r *WebsiteSSLUploadResponse) GetMessage() string

type WebsiteSearchRequest added in v0.4.6

type WebsiteSearchRequest struct {
	WebsiteGroupId int64  `json:"websiteGroupId"`
	Name           string `json:"name"`
	Type           string `json:"type"`
	Order          string `json:"order"`
	OrderBy        string `json:"orderBy"`
	Page           int32  `json:"page"`
	PageSize       int32  `json:"pageSize"`
}

type WebsiteSearchResponse added in v0.4.6

type WebsiteSearchResponse struct {
	Data *struct {
		Items []*Website `json:"items"`
		Total int32      `json:"total"`
	} `json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*WebsiteSearchResponse) GetCode added in v0.4.6

func (r *WebsiteSearchResponse) GetCode() int

func (*WebsiteSearchResponse) GetMessage added in v0.4.6

func (r *WebsiteSearchResponse) GetMessage() string

Jump to

Keyboard shortcuts

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