cloudflare

package
v0.0.0-...-92afb07 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 9 Imported by: 1

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 MakeApiClient

func MakeApiClient(authToken *string) *openapi.APIClient

func Register

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

Types

type Account

func GetAccount

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

type 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 UpdateSourceBoundDevice

func UpdateSourceBoundDevice(ctx *config.Context, data openapi.UpdateBoundDeviceRequest) (*BoundDevice, error)

func UpdateSourceBoundDeviceActive

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

func UpdateSourceBoundDeviceName

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

type Device

func GetSourceDevice

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

func UpdateLicenseKey

func UpdateLicenseKey(ctx *config.Context, newPublicKey string) (*openapi.UpdateAccount200Response, *Device, error)

Jump to

Keyboard shortcuts

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