infrastructure

package
v0.0.0-...-1046031 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetHttpStrategy

func SetHttpStrategy(s HttpSecurity)

Types

type AlpacaStrategy

type AlpacaStrategy struct{}

func (AlpacaStrategy) Add

func (a AlpacaStrategy) Add(data *HttpReqData)

type HttpReqData

type HttpReqData struct {
	BaseUrl         string
	Path            string
	Headers         http.Header
	ParamUrl        map[string]string // parameters in URL example: local?test=1&other=2
	Method          string
	DisableStrategy bool
}

data for http request

type HttpSecurity

type HttpSecurity struct {
	GlobalUrlBackend string // url for server request token etc
	Strategy         HttpSecurityStrategy
}

type HttpSecurityStrategy

type HttpSecurityStrategy interface {
	Add(data *HttpReqData)
}

type MongoDatabase

type MongoDatabase struct {
	Client *mongo.Client
}

func GetMongoDatabase

func GetMongoDatabase() *MongoDatabase

type MongoParams

type MongoParams struct {
	User     string
	Password string
	Host     string
	Port     string
	Database string
}
var MongoParamsLocal MongoParams

type RespHttp

type RespHttp struct {
	Body       map[string]interface{}
	Headers    http.Header
	StatusCode int
}

data response http request

func Do

func Do(data HttpReqData) (RespHttp, error)

Call Http request get

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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