proxy

package
v0.0.0-...-1e9d811 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2018 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host       string
	Port       int
	ScriptPath string
	ScriptName string
	ClientIP   string
	ClientPort string
}

type GRPCProxy

type GRPCProxy struct {
	Logger  logrus.FieldLogger
	Handler func(ctx context.Context, ts *transport.Stream, t transport.ServerTransport)
}

func (*GRPCProxy) Serve

func (gp *GRPCProxy) Serve(ctx context.Context, lis net.Listener) error

type GraylogOptions

type GraylogOptions struct {
	Host string
	Port string
}

type Options

type Options struct {
	Debug        bool   `default:"false"`
	Host         string `required:"true"`
	KeyFile      string
	CrtFile      string
	InstanceName string `required:"true"`
	Target       TargetOptions
	Graylog      GraylogOptions
}

func LoadConfig

func LoadConfig() (*Options, error)

type Request

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

func MakeRequest

func MakeRequest(config Config) Request

func (*Request) Do

func (r *Request) Do(ctx context.Context, request string, headers map[string][]string, sr SizedReader, usePool bool) ([]byte, http.Header, error)

TODO: Add connection pooling even if we use connection only once

type SizedReader

type SizedReader interface {
	io.Reader
	Size() int64
}

type StreamHandler

type StreamHandler struct {
	Logger        logrus.FieldLogger
	PortalOptions TargetOptions
}

func (*StreamHandler) HandleStream

func (s *StreamHandler) HandleStream(ctx context.Context, ts *transport.Stream, t transport.ServerTransport)

type TargetOptions

type TargetOptions struct {
	Host        string `required:"true"`
	Port        int    `required:"true"`
	Name        string
	ScriptPath  string `required:"true"`
	ScriptName  string `required:"true"`
	ClientIP    string
	ReturnError bool
}

Jump to

Keyboard shortcuts

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