Help us shape the future of Go! Take the 2026 Go Developer Survey

cloudflare

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApiUrl     = "https://api.cloudflareclient.com"
	ApiVersion = "v0a1922"
)

Variables

View Source
var (
	DefaultHeaders = map[string]string{
		"User-Agent":        "okhttp/3.12.1",
		"CF-Client-Version": "a-6.3-1922",
	}
	DefaultTransport = &http.Transport{

		TLSClientConfig: &tls.Config{
			MinVersion: tls.VersionTLS12,
			MaxVersion: tls.VersionTLS12},
		ForceAttemptHTTP2: false,

		Proxy:                 http.ProxyFromEnvironment,
		MaxIdleConns:          100,
		IdleConnTimeout:       90 * time.Second,
		TLSHandshakeTimeout:   10 * time.Second,
		ExpectContinueTimeout: 1 * time.Second,
	}
)

Functions

func DeleteBoundDevice

func DeleteBoundDevice(apiClient *openapi.APIClient, ctx *config.Context, targetDeviceId string) error

func NewApiClient added in v0.0.2

func NewApiClient(authToken *string, transport *http.Transport) *openapi.APIClient

func Register

func Register(apiClient *openapi.APIClient, publicKey *wireguard.Key, deviceModel string) (*openapi.Register200Response, error)

func UpdateLicenseKey

func UpdateLicenseKey(apiClient *openapi.APIClient, ctx *config.Context) (*openapi.UpdateAccount200Response, error)

Types

type Account

type Account openapi.Account

func GetAccount

func GetAccount(apiClient *openapi.APIClient, ctx *config.Context) (*Account, error)

type BoundDevice

type BoundDevice openapi.BoundDevice

func FindDevice

func FindDevice(devices []BoundDevice, deviceId string) (*BoundDevice, error)

func GetBoundDevices

func GetBoundDevices(apiClient *openapi.APIClient, ctx *config.Context) ([]BoundDevice, error)

func GetSourceBoundDevice

func GetSourceBoundDevice(apiClient *openapi.APIClient, ctx *config.Context) (*BoundDevice, error)

func UpdateSourceBoundDeviceActive

func UpdateSourceBoundDeviceActive(apiClient *openapi.APIClient, ctx *config.Context, targetDeviceId string, active bool) (*BoundDevice, error)

func UpdateSourceBoundDeviceName

func UpdateSourceBoundDeviceName(apiClient *openapi.APIClient, ctx *config.Context, targetDeviceId string, newName string) (*BoundDevice, error)

type SourceDevice

func GetSourceDevice

func GetSourceDevice(apiClient *openapi.APIClient, ctx *config.Context) (*SourceDevice, error)

Jump to

Keyboard shortcuts

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