ops

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, Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package ops wraps github.com/getlantern/ops with convenience methods for flashlight

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Go

func Go(fn func())

Go mimics the similar method from ops.

func RegisterReporter

func RegisterReporter(reporter ops.Reporter)

RegisterReporter mimics the similar method from ops

func SetGlobal

func SetGlobal(key string, value interface{})

SetGlobal mimics the similar method from ops

func SetGlobalDynamic

func SetGlobalDynamic(key string, valueFN func() interface{})

SetGlobalDynamic mimics the similar method from ops

Types

type Op

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

Op decorates an ops.Op with convenience methods.

func Begin

func Begin(name string) *Op

Begin mimics the similar method from ops

func (*Op) Begin

func (op *Op) Begin(name string) *Op

Begin mimics the similar method from ops.Op

func (*Op) ChainedProxy

func (op *Op) ChainedProxy(addr string, protocol string) *Op

ChainedProxy attaches chained proxy information to the Context

func (*Op) End

func (op *Op) End()

End mimics the similar method from ops.Op

func (*Op) FailIf

func (op *Op) FailIf(err error) error

FailIf mimics the similar method from ops.op

func (*Op) Go

func (op *Op) Go(fn func())

Go mimics the similar method from ops.Op

func (*Op) Origin

func (op *Op) Origin(v string) *Op

Origin attaches the origin to the Contetx

func (*Op) ProxyAddr

func (op *Op) ProxyAddr(v string) *Op

ProxyAddr attaches proxy server address to the Context

func (*Op) ProxyProtocol

func (op *Op) ProxyProtocol(v string) *Op

ProxyProtocol attaches proxy server's protocol to the Context

func (*Op) ProxyType

func (op *Op) ProxyType(v ProxyType) *Op

ProxyType attaches proxy type to the Context

func (*Op) Request

func (op *Op) Request(r *http.Request) *Op

Request attaches key information of an `http.Request` to the Context.

func (*Op) Response

func (op *Op) Response(r *http.Response) *Op

Response attaches key information of an `http.Response` to the Context. If the response has corresponding Request it will call Request internally.

func (*Op) Set

func (op *Op) Set(key string, value interface{}) *Op

Set mimics the similar method from ops.Op

func (*Op) SetDynamic

func (op *Op) SetDynamic(key string, valueFN func() interface{}) *Op

SetDynamic mimics the similar method from ops.Op

func (*Op) UserAgent

func (op *Op) UserAgent(v string) *Op

UserAgent attaches a user agent to the Context.

type ProxyType

type ProxyType string

ProxyType is the type of various proxy channel

const (
	// ProxyNone means direct access, not proxying at all
	ProxyNone ProxyType = "none"
	// ProxyChained means access through Lantern hosted chained server
	ProxyChained ProxyType = "chained"
	// ProxyFronted means access through domain fronting
	ProxyFronted ProxyType = "fronted"
)

Jump to

Keyboard shortcuts

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