brute

package module
v0.0.0-...-683daf5 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2018 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddEndpoint

func AddEndpoint(route *Route)

func BuildDebugEndpoint

func BuildDebugEndpoint(route Route, sourceCode, reasons []byte)

func CleanUp

func CleanUp()

func Delegate

func Delegate(w http.ResponseWriter, stream <-chan *EchoPacket)

func Deploy

func Deploy(config *Config)

func HandshakeFormat

func HandshakeFormat(initial []byte) bool

func HostRootEndpoint

func HostRootEndpoint()

func HostStaticFiles

func HostStaticFiles()

func New

func New(config *Config)

func RandomNumber

func RandomNumber() uint16

func RandomSessionId

func RandomSessionId(ip string, unixSeconds int64) [32]byte

func RunEndpointService

func RunEndpointService() net.Listener

func SetHttpPort

func SetHttpPort(port int)

func SetProjectName

func SetProjectName(name string)

func SetSecureHttpPort

func SetSecureHttpPort(port int)

func StartAuthorizer

func StartAuthorizer(config *Config)

func StartEndpoint

func StartEndpoint(route Route)

func StartEndpoints

func StartEndpoints(config *Config)

func StartRootEndpoint

func StartRootEndpoint(route Route)

Types

type AuthorizeHandler

type AuthorizeHandler interface {
	Success(handler http.HandlerFunc) AuthorizeHandler
	Failed(handler http.HandlerFunc) AuthorizeHandler
	Handler() http.HandlerFunc
}

func LoadAuthorizer

func LoadAuthorizer(route Route) AuthorizeHandler

type Config

type Config struct {
	Name       string  `yaml:"name"`
	Remote     string  `yaml:"remote"`
	Authorizer *string `yaml:authorizer`
	Routes     []Route `yaml:,flow`
}

type ConnWrite

type ConnWrite struct {
	io.Reader
	net.Conn
	*sync.Mutex
}

func (*ConnWrite) Write

func (connWriter *ConnWrite) Write(data []byte) (int, error)

type ConnWriter

type ConnWriter interface {
	Close() error
	Write([]byte) (int, error)
}

type ContextHolder

type ContextHolder struct {
	RpcArguments map[string]string
	Stream       chan *EchoPacket
	End          chan bool
	Message      url.Values
	Method       string
	Route
}

type ControllerEndpoint

type ControllerEndpoint struct {
	ProjectName string
	Route
	// contains filtered or unexported fields
}

func (*ControllerEndpoint) RedirectEndpointOnError

func (controller *ControllerEndpoint) RedirectEndpointOnError(w http.ResponseWriter, r *http.Request, logic func() []byte)

func (*ControllerEndpoint) RedirectEndpointOnLoading

func (controller *ControllerEndpoint) RedirectEndpointOnLoading(w http.ResponseWriter, r *http.Request)

func (*ControllerEndpoint) ServeHTTP

func (controller *ControllerEndpoint) ServeHTTP(w http.ResponseWriter, r *http.Request)

type CustomConcurrentMap

type CustomConcurrentMap struct {
	sync.Map
}

func (*CustomConcurrentMap) Delete

func (customConcurrentMap *CustomConcurrentMap) Delete(key string)

func (*CustomConcurrentMap) Load

func (customConcurrentMap *CustomConcurrentMap) Load(key string) (ConnWriter, bool)

func (*CustomConcurrentMap) Store

func (customConcurrentMap *CustomConcurrentMap) Store(key string, value ConnWriter)

type EchoPacket

type EchoPacket struct {
	SessionId [32]byte
	Body      []byte
	Code      int
}

type EndpointFunc

type EndpointFunc func() []byte

func (EndpointFunc) Close

func (endpointFunc EndpointFunc) Close() error

func (EndpointFunc) Write

func (endpointFunc EndpointFunc) Write(data []byte) (int, error)

type MiddlewareWriterContext

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

func (*MiddlewareWriterContext) Header

func (context *MiddlewareWriterContext) Header() http.Header

func (*MiddlewareWriterContext) Write

func (context *MiddlewareWriterContext) Write(data []byte) (int, error)

func (*MiddlewareWriterContext) WriteHeader

func (context *MiddlewareWriterContext) WriteHeader(statusCode int)

type RequestSession

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

func (*RequestSession) AcceptRpc

func (sessions *RequestSession) AcceptRpc(id [32]byte, ack *struct {
	Method    string
	Message   url.Values
	Arguments map[string]string
}) error

func (*RequestSession) Close

func (sessions *RequestSession) Close(packet *EchoPacket, ack *bool) error

func (*RequestSession) Write

func (sessions *RequestSession) Write(packet *EchoPacket, ack *bool) error

type Route

type Route struct {
	Path         string `yaml:"path"`
	Directory    string `yaml:"directory"`
	*RouteConfig `yaml:"config"`
	// contains filtered or unexported fields
}

type RouteConfig

type RouteConfig struct {
	Protected bool   `yaml:"protected"`
	Timeout   string `yaml:"timeout"`
	Activate  string `yaml:"activate"`
}

type Source

type Source []string

func Compile

func Compile(source []byte) Source

Directories

Path Synopsis
TODO: Supply clients' http.Request info
TODO: Supply clients' http.Request info
cmd
ui

Jump to

Keyboard shortcuts

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