lib

package
v0.0.0-...-3ca04e8 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: MIT Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AfterReceive

type AfterReceive func(http.ResponseWriter, *http.Response) error

AfterReceive defines after receive callback function

type BeforeSend

type BeforeSend func(http.ResponseWriter, *http.Request) error

BeforeSend defines before send callback function

type GisInfo

type GisInfo struct {
	ServerURL   string
	ServerType  string
	ServiceType string
	ServiceName string
}

GisInfo structure

func GisInfoFromContext

func GisInfoFromContext(ctx context.Context) *GisInfo

GisInfoFromContext retrives GisInfo from context

func (*GisInfo) String

func (gi *GisInfo) String() string

type GisProxy

type GisProxy struct {
	Prefix           string
	AllowCrossOrigin bool
	// contains filtered or unexported fields
}

GisProxy structure

func GisProxyFromContext

func GisProxyFromContext(ctx context.Context) *GisProxy

GisProxyFromContext retrives GisProxy from context

func NewGisProxy

func NewGisProxy(listen string, prefix string, allowCrossOrigin bool) *GisProxy

NewGisProxy constructs GisProxy

func (*GisProxy) ComputeForwardUrl

func (gp *GisProxy) ComputeForwardUrl(incomingRequest *http.Request) (*url.URL, error)

ComputeRewriteUrl computes forward url

func (*GisProxy) SendRequestWithContext

func (gp *GisProxy) SendRequestWithContext(ctx context.Context, writer http.ResponseWriter, method string, url *url.URL, body io.Reader, header http.Header) (*http.Response, error)

SendRequestWithContext sends request with context

func (*GisProxy) ServeHTTP

func (gp *GisProxy) ServeHTTP(writer http.ResponseWriter, incomingRequest *http.Request)

ServeHTTP serves rest request

func (*GisProxy) SetAfterReceiveFunc

func (gp *GisProxy) SetAfterReceiveFunc(afterReceiveFunc AfterReceive)

SetAfterReceiveFunc sets AfterReceive callback function

func (*GisProxy) SetBeforeSendFunc

func (gp *GisProxy) SetBeforeSendFunc(beforeSendFunc BeforeSend)

SetBeforeSendFunc sets BeforeSend callback function

func (*GisProxy) SetNextHandler

func (gp *GisProxy) SetNextHandler(next http.Handler)

SetNextHandler sets next handler for middleware use

func (*GisProxy) Start

func (gp *GisProxy) Start() error

func (*GisProxy) Stop

func (gp *GisProxy) Stop(timeout time.Duration) error

func (*GisProxy) UseHttps

func (gp *GisProxy) UseHttps(crtfile string, keyfile string)

UseHttps uses Https with certificate

type StatusError

type StatusError struct {
	Message string
	Code    int
}

StatusError struct

func NewStatusError

func NewStatusError(message string, code int) *StatusError

NewStatusError constructs StatusError

func (*StatusError) Error

func (e *StatusError) Error() string

Error implements the error interface

Jump to

Keyboard shortcuts

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