frontender: Index | Files | Directories

package frontender

import ""


Package Files

frontender.go gen.go

func GenerateBinary Uses

func GenerateBinary(req *DeployInfo) (io.ReadCloser, error)

func GenerateDockerImage Uses

func GenerateDockerImage(req *DeployInfo) (imageName string, err error)

func GenerateDockerImageForGCE Uses

func GenerateDockerImageForGCE(req *DeployInfo) (imageName string, err error)

type BinaryHandle Uses

type BinaryHandle struct {
    // contains filtered or unexported fields

func (*BinaryHandle) Close Uses

func (bh *BinaryHandle) Close() error

func (*BinaryHandle) Read Uses

func (bh *BinaryHandle) Read(b []byte) (int, error)

type Dependency Uses

type Dependency struct {
    LocalPath  string
    DockerPath string

type DeployInfo Uses

type DeployInfo struct {
    FrontendConfig *Request
    SourceImage    string
    ImageName      string

    TargetGOOS string
    Environ    []string

    CanonicalImageName       string `json:"canonical_image_name"`
    CanonicalImageNamePrefix string `json:"canonical_image_name_prefix"`

type DockerConfig Uses

type DockerConfig struct {
    PrerunCommands []string      `json:"prerun_commands"`
    Dependencies   []*Dependency `json:"dependencies"`
    ImageName      string        `json:"image_name"`
    SourceImage    string        `json:"source_image"`
    BinaryPath     string        `json:"binary_path"`

type ListenConfirmation Uses

type ListenConfirmation struct {
    // contains filtered or unexported fields

func Listen Uses

func Listen(req *Request) (*ListenConfirmation, error)

The goal is to be able to pass in proxy servers, keep a persistent connection to each one of them and use that as the weight to figure out which one to send traffic to.

func (*ListenConfirmation) Close Uses

func (lc *ListenConfirmation) Close() error

func (*ListenConfirmation) Wait Uses

func (lc *ListenConfirmation) Wait() error

type Request Uses

type Request struct {
    // HTTP1 signifies that this server should
    // not be ran as an HTTP/2<-->HTTPS server.
    // This variable is useful for testing purposes.
    HTTP1 bool `json:"http1"`

    Domains []string `json:"domains"`

    NoAutoWWW bool `json:"no_auto_www"`

    ProxyAddresses []string `json:"proxy_addresses"`

    NonHTTPSRedirectURL string `json:"non_https_redirect_url"`
    NonHTTPSAddr        string `json:"non_https_addr"`

    DomainsListener func(domains ...string) net.Listener

    Environ    []string `json:"environ"`
    TargetGOOS string   `json:"target_goos"`

    CertKeyFiler func() (string, string)

    // BackendPingPeriod if set, defines the period
    // between which the frontend service will check
    // for the liveliness of the backends.
    BackendPingPeriod time.Duration

    // PrefixRouter if set helps route traffic depending on
    // the route prefix e.g
    // {
    //    "/bar": ["http://localhost:7997", "http://localhost:8888"],
    //    "/foo": ["http://localhost:8999", "http://localhost:8877"]
    // }
    // if it gets traffic with a URL prefix "/foo" will distribute traffic
    // between "http://localhost:8999" and "http://localhost:8877".
    PrefixRouter map[string][]string `json:"routing"`

func (*Request) SynthesizeDomains Uses

func (req *Request) SynthesizeDomains() []string

Synthesizes domains removing duplicates and if NoAutoWWW if not set, will automatically make the corresponding www.domain domain.

func (*Request) Validate Uses

func (req *Request) Validate() error

type Server Uses

type Server struct {
    Domains []string `json:"domains"`

    ProxyAddresses []string `json:"proxy_addresses"`

    NonHTTPSRedirectURL string `json:"non_https_redirect_url"`



Package frontender imports 23 packages (graph) and is imported by 1 packages. Updated 2017-12-30. Refresh now. Tools for package owners.