config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultsAws = Aws{
		Use:      false,
		Endpoint: "http://localhost:9200",
		Service:  "es",
	}
	EnvAws = Aws{
		Use:      hasEnvVar("AWS_SIGNING"),
		Endpoint: os.Getenv("AWS_ENDPOINT"),
		Service:  os.Getenv("AWS_SERVICE"),
	}
)
View Source
var (
	DefaultCurl = Curl{
		Method: "GET",
		Headers: http.Header{
			"Content-Type": []string{"application/json"},
		},
		Path: "/",
		Aws:  DefaultsAws,
	}
	EnvCurl = Curl{
		Aws: EnvAws,
	}
)
View Source
var (
	DefaultReverseProxy = ReverseProxy{
		Port: 9200,
		Aws:  DefaultsAws,
	}
	EnvReverseProxy = ReverseProxy{
		Aws: EnvAws,
	}
)

Functions

func HclUnmarshalDir

func HclUnmarshalDir(dir string, v interface{}) error

Types

type Aws

type Aws struct {
	Use      bool   `hcl:"enabled"`
	Service  string `hcl:"service"`
	Endpoint string `hcl:"endpoint"`
}

func MergeAws

func MergeAws(cfgs ...Aws) Aws

func (Aws) EndpointUrl

func (a Aws) EndpointUrl() *url.URL

func (Aws) Transport

func (a Aws) Transport(ctx context.Context) (http.RoundTripper, error)

type Curl

type Curl struct {
	Data    string      `hcl:"-"`
	Method  string      `hcl:"-"`
	Headers http.Header `hcl:"-"`
	Path    string      `hcl:"-"`
	Aws     Aws         `hcl:"aws"`
	Debug   bool        `hcl:"-"`
}

func MergeCurl

func MergeCurl(cfgs ...Curl) Curl

func (Curl) RequestBody

func (c Curl) RequestBody() io.Reader

func (Curl) RequestUrl

func (c Curl) RequestUrl() string

type ReverseProxy

type ReverseProxy struct {
	Port int `hcl:"port"`
	Aws  Aws `hcl:"aws"`
}

func MergeReverseProxy

func MergeReverseProxy(cfgs ...ReverseProxy) ReverseProxy

Jump to

Keyboard shortcuts

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