tunnels

package
v1.3.17 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AnonUserCredentials = UserCredentials{
	ClientID:     "00000000-0000-0000-0000-000000000000",
	ClientSecret: "",
}

Functions

This section is empty.

Types

type ApiClient

type ApiClient interface {
	Authorise(context.Context, string) error
	CreateWebhook(context.Context, WebhookRequest) (string, error)
	PatchWebhook(context.Context, string, WebhookRequest) error
	DeleteWebhook(context.Context, string) error
	OpenEndpoint(context.Context) (string, string, error)
	CloseEndpoint(context.Context, string) error
	GetEvents(context.Context, string) ([]ui.PullItem, int, error)
	TunnelIsReady(context.Context) error
}

func NewClient

func NewClient(proxyAddress string, usersCredentials UserCredentials, timeout time.Duration) ApiClient

type Tunnels

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

func CreateTunnels

func CreateTunnels(logger logger.Logger, events []string, proxyAddress string, createApiClient func(credentials UserCredentials) ApiClient, logHeaders bool) *Tunnels

func (*Tunnels) Start

func (e *Tunnels) Start(userCredentialsCh chan UserCredentials)

func (*Tunnels) Stop

func (e *Tunnels) Stop()

type UserCredentials

type UserCredentials struct {
	ClientID     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
}

func (UserCredentials) Empty

func (e UserCredentials) Empty() bool

type WebhookConfig

type WebhookConfig struct {
	Delay          string `json:"delay,omitempty"`
	MaxPackageSize int    `json:"max_package_size,omitempty"`
}

type WebhookRequest

type WebhookRequest struct {
	Title   string         `json:"title"`
	Url     string         `json:"url"`
	Type    []string       `json:"type"`
	Enabled bool           `json:"enabled,omitempty"`
	Config  *WebhookConfig `json:"config,omitempty"`
}

WebhookRequest see: https://docs.upvest.co/documentation/getting_started/implementing_webhooks/webhook_registration

Jump to

Keyboard shortcuts

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