cloudflare

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var (
	DefaultHeaders = map[string]string{
		"User-Agent":        "1.1.1.1/6.38.9-5641 (Android 16.0.0)",
		"CF-Client-Version": "a-6.38.9-5641",
	}

	DefaultTransport = &http.Transport{

		TLSClientConfig:   warpTLSConfig,
		DialTLSContext:    dialWarpTLS,
		ForceAttemptHTTP2: false,

		MaxIdleConns:          100,
		IdleConnTimeout:       90 * time.Second,
		TLSHandshakeTimeout:   warpTLSHandshakeTimeout,
		ExpectContinueTimeout: 1 * time.Second,
	}
)

Functions

func DeleteBoundDevice added in v2.2.29

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

func MakeApiClient

func MakeApiClient(authToken *string) *openapi.APIClient

func Register

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

func UpdateLicenseKey

func UpdateLicenseKey(ctx *config.Context) error

func WireGuardEndpoint added in v2.3.0

func WireGuardEndpoint(endpoint openapi.Endpoint) (string, error)

Types

type Account

type Account openapi.Account

func GetAccount

func GetAccount(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(ctx *config.Context) ([]BoundDevice, error)

func GetSourceBoundDevice

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

func UpdateSourceBoundDeviceActive

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

func UpdateSourceBoundDeviceName

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

type SourceDevice added in v2.2.29

func GetSourceDevice

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

Jump to

Keyboard shortcuts

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