proxy

package
v1.2.20210816 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package proxy defines logic for calling into the admin API of the proxy

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Admin

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

Admin implements the admin API for a proxy.

func NewAdmin

func NewAdmin(client *http.Client, url string) *Admin

NewAdmin returns a new Admin implementation.

`client` defines an HTTP client that can be used to issue API calls to the proxy, and `url` is the address of the proxy API.

The provided client should already be authenticated (e.g. already have OAuth credentials attached) prior to being passed to this method.

func (*Admin) IdleBackends

func (a *Admin) IdleBackends(idleDuration time.Duration) ([]string, error)

IdleBackends returns the list of all backends that have been idle for longer than the specified duration.

func (*Admin) RegisterBackend

func (a *Admin) RegisterBackend(vm *compute.Instance, user string) error

RegisterBackend registers that the given VM should act as a sever backend for the specified user.

type Backend

type Backend struct {
	ID           string    `json:"id,omitempty"`
	EndUser      string    `json:"endUser,omitempty"`
	BackendUser  string    `json:"backendUser,omitempty"`
	PathPrefixes []string  `json:"pathPrefixes,omitempty"`
	LastUsed     time.Time `json:"lastUsed,omitempty"`
}

Backend defines an entry in the proxy for server backends.

Jump to

Keyboard shortcuts

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