onepanel

package
v0.4.27 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

A simple SDK client for 1Panel v1. API documentation: https://1panel.cn/docs/v1/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) SetTLSConfig

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

func (*Client) SetTimeout

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

func (*Client) SettingsSSLUpdate added in v0.4.6

func (c *Client) SettingsSSLUpdate(req *SettingsSSLUpdateRequest) (*SettingsSSLUpdateResponse, error)

func (*Client) SettingsSSLUpdateWithContext added in v0.4.6

func (c *Client) SettingsSSLUpdateWithContext(ctx context.Context, req *SettingsSSLUpdateRequest) (*SettingsSSLUpdateResponse, error)

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.6

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 Options added in v0.4.25

type Options struct {
	ApiKey string
}

type OptionsFunc added in v0.4.25

type OptionsFunc func(*Options)

func WithApiKey added in v0.4.25

func WithApiKey(apiKey string) OptionsFunc

type SSLCertificate added in v0.4.26

type SSLCertificate struct {
	ID          int64  `json:"id"`
	PEM         string `json:"pem"`
	PrivateKey  string `json:"privateKey"`
	Domains     string `json:"domains"`
	Description string `json:"description"`
	Status      string `json:"status"`
	UpdatedAt   string `json:"updatedAt"`
	CreatedAt   string `json:"createdAt"`
}

type SettingsSSLUpdateRequest added in v0.4.6

type SettingsSSLUpdateRequest 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 SettingsSSLUpdateResponse added in v0.4.6

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

func (*SettingsSSLUpdateResponse) GetCode added in v0.4.6

func (r *SettingsSSLUpdateResponse) GetCode() int

func (*SettingsSSLUpdateResponse) GetMessage added in v0.4.6

func (r *SettingsSSLUpdateResponse) GetMessage() string

type Website added in v0.4.26

type Website struct {
	ID            int64  `json:"id"`
	Alias         string `json:"alias"`
	PrimaryDomain string `json:"primaryDomain"`
	Protocol      string `json:"protocol"`
	Type          string `json:"type"`
	Status        string `json:"status"`
	SitePath      string `json:"sitePath"`
	Remark        string `json:"remark"`
	SSLStatus     string `json:"sslStatus,omitempty"`
	SSLExpireDate string `json:"sslExpireDate,omitempty"`
	WebsiteSSLID  int64  `json:"webSiteSSLId,omitempty"`
	UpdatedAt     string `json:"updatedAt"`
	CreatedAt     string `json:"createdAt"`
}

type WebsiteDetail added in v0.4.26

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

type WebsiteDomainConfig added in v0.4.26

type WebsiteDomainConfig struct {
	ID        int64  `json:"id"`
	Domain    string `json:"domain"`
	Port      int32  `json:"port"`
	SSL       bool   `json:"ssl"`
	UpdatedAt string `json:"updatedAt"`
	CreatedAt string `json:"createdAt"`
}

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 {
	Enable       bool     `json:"enable"`
	WebsiteSSLID int64    `json:"websiteSSLId"`
	HttpConfig   string   `json:"httpConfig"`
	SSLProtocol  []string `json:"SSLProtocol"`
	Algorithm    string   `json:"algorithm"`
	Hsts         bool     `json:"hsts"`
}

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"`
}

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"`
	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 {
	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

Directories

Path Synopsis
A simple SDK client for 1Panel v2.
A simple SDK client for 1Panel v2.

Jump to

Keyboard shortcuts

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