cloudflare

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type APIMessage

type APIMessage struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type APIResponse

type APIResponse struct {
	Success  bool            `json:"success"`
	Errors   []APIError      `json:"errors"`
	Messages []APIMessage    `json:"messages"`
	Result   json.RawMessage `json:"result"`
}

type Account

type Account struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type AccountListResult

type AccountListResult struct {
	Accounts []Account
}

type Client

type Client struct {
	Token      string
	AccountID  string
	HTTPClient *http.Client
	Debug      bool
}

func NewClient

func NewClient(token, accountID string) *Client

func (*Client) CreateProject

func (c *Client) CreateProject(name string) (*Project, error)

func (*Client) DeleteDeployment

func (c *Client) DeleteDeployment(projectName, deploymentID string) error

DeleteDeployment deletes a specific deployment.

func (*Client) Deploy

func (c *Client) Deploy(projectName string, files []FileEntry) (*Deployment, error)

Deploy uploads files and creates a deployment. Returns the deployment info.

func (*Client) DetectAccountID

func (c *Client) DetectAccountID() (string, error)

func (*Client) GetProject

func (c *Client) GetProject(name string) (*Project, error)

func (*Client) ListAccounts

func (c *Client) ListAccounts() ([]Account, error)

func (*Client) ListDeployments

func (c *Client) ListDeployments(projectName string) ([]Deployment, error)

ListDeployments returns recent deployments for a project.

type Deployment

type Deployment struct {
	ID          string    `json:"id"`
	URL         string    `json:"url"`
	CreatedOn   time.Time `json:"created_on"`
	Aliases     []string  `json:"aliases"`
	LatestStage *Stage    `json:"latest_stage"`
}

type FileEntry

type FileEntry struct {
	Path        string
	Content     []byte
	Hash        string
	ContentType string
}

func PrepareFiles

func PrepareFiles(path string) ([]FileEntry, error)

PrepareFiles reads files from a path (file or directory) and returns FileEntry list.

type Project

type Project struct {
	Name string `json:"name"`
	ID   string `json:"id"`
}

type Stage

type Stage struct {
	Name   string `json:"name"`
	Status string `json:"status"`
}

type UploadTokenResult

type UploadTokenResult struct {
	JWT string `json:"jwt"`
}

Jump to

Keyboard shortcuts

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