proxiedsites

package
v0.0.0-...-8b1022e Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

README

proxiedsites

Package for managing lists of proxied sites.

Documentation

Overview

proxiedsites manages a list of proxied sites, including a default set of sites (cloud) and user-applied customizations to that list. It provides an implementation of the http.Handler interface that serves up a PAC file based on the currently active proxied sites (cloud + additions - deletions).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// User customizations
	*Delta

	// Global list of white-listed sites
	Cloud []string
}

Config is the whole configuration for proxiedsites.

type Delta

type Delta struct {
	Additions []string `json:"additions"`
	Deletions []string `json:"deletions"`
}

Delta represents modifications to the proxied sites list.

func ActiveDelta

func ActiveDelta() *Delta

ActiveDelta returns the active sites as a Delta of additions.

func Configure

func Configure(cfg *Config) *Delta

Configure applies the given configuration. If there were changes, a Delta is returned that includes the additions and deletions from the active list. If there were no changes, or the changes couldn't be applied, this method returns a nil Delta.

func (*Delta) Merge

func (d *Delta) Merge(n *Delta)

Merge merges the given delta into the existing one.

Jump to

Keyboard shortcuts

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