http

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2021 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetDefaultHTTPFlagsPrefix

func SetDefaultHTTPFlagsPrefix(prefix string)

func SetDefaultHTTPIdleTimeout

func SetDefaultHTTPIdleTimeout(val time.Duration)

func SetDefaultHTTPMaxHeaderBytes

func SetDefaultHTTPMaxHeaderBytes(val int)

func SetDefaultHTTPName

func SetDefaultHTTPName(name string)

func SetDefaultHTTPPort

func SetDefaultHTTPPort(val string)

func SetDefaultHTTPReadHeaderTimeout

func SetDefaultHTTPReadHeaderTimeout(val time.Duration)

func SetDefaultHTTPReadTimeout

func SetDefaultHTTPReadTimeout(val time.Duration)

func SetDefaultHTTPRunnable

func SetDefaultHTTPRunnable(b bool)

func SetDefaultHTTPSFlagsPrefix

func SetDefaultHTTPSFlagsPrefix(prefix string)

func SetDefaultHTTPSIdleTimeout

func SetDefaultHTTPSIdleTimeout(val time.Duration)

func SetDefaultHTTPSMaxHeaderBytes

func SetDefaultHTTPSMaxHeaderBytes(val int)

func SetDefaultHTTPSName

func SetDefaultHTTPSName(name string)

func SetDefaultHTTPSPort

func SetDefaultHTTPSPort(val string)

func SetDefaultHTTPSReadHeaderTimeout

func SetDefaultHTTPSReadHeaderTimeout(val time.Duration)

func SetDefaultHTTPSReadTimeout

func SetDefaultHTTPSReadTimeout(val time.Duration)

func SetDefaultHTTPSRunnable

func SetDefaultHTTPSRunnable(b bool)

func SetDefaultHTTPSWriterTimeout

func SetDefaultHTTPSWriterTimeout(val time.Duration)

func SetDefaultHTTPWriterTimeout

func SetDefaultHTTPWriterTimeout(val time.Duration)

Types

type HTTP

type HTTP struct {
	Name              string        `json:"name" yaml:"name"`
	Runnable          bool          `mapstructure:"http" json:"runnable" yaml:"runnable"`
	Port              string        `json:"port" yaml:"port"`
	ReadTimeout       time.Duration `json:"read-timeout" yaml:"read-timeout"`
	ReadHeaderTimeout time.Duration `json:"read-header-timeout" yaml:"read-header-timeout"`
	WriteTimeout      time.Duration `json:"write-timeout" yaml:"write-timeout"`
	IdleTimeout       time.Duration `json:"idle-timeout" yaml:"idle-timeout"`
	MaxHeaderBytes    int           `json:"max-header-bytes" yaml:"max-header-bytes"`

	// CustomBindFlagsFunc defines custom bind flags behaviour for structure, if CustomBindFlagsFunc is nil, default  bind flags behaviour will be used
	CustomBindFlagsFunc func(fs *bootflag.FlagSet) `json:"-" yaml:"-"`

	// CustomParseFunc defines custom parse behaviour for structure, if CustomParseFunc is nil, default parse behaviour will be used
	CustomParseFunc func() (err error) `json:"-" yaml:"-"`
}

func (*HTTP) BindFlags

func (http *HTTP) BindFlags(fs *bootflag.FlagSet)

func (*HTTP) GetIntPort

func (http *HTTP) GetIntPort() (port int)

func (*HTTP) Parse

func (http *HTTP) Parse() (err error)

type HTTPS

type HTTPS struct {
	Name              string        `json:"name" yaml:"name"`
	Runnable          bool          `json:"runnable" yaml:"runnable"`
	Port              string        `json:"port" yaml:"port"`
	ReadTimeout       time.Duration `json:"read-timeout" yaml:"read-timeout"`
	ReadHeaderTimeout time.Duration `json:"read-header-timeout" yaml:"read-header-timeout"`
	WriteTimeout      time.Duration `json:"write-timeout" yaml:"write-timeout"`
	IdleTimeout       time.Duration `json:"idle-timeout" yaml:"idle-timeout"`
	MaxHeaderBytes    int           `json:"max-header-bytes" yaml:"max-header-bytes"`

	Cert string `json:"cert" yaml:"cert"`
	Key  string `json:"key" yaml:"key"`

	// CustomBindFlagsFunc defines custom bind flags behaviour for structure, if CustomBindFlagsFunc is nil, default  bind flags behaviour will be used
	CustomBindFlagsFunc func(fs *bootflag.FlagSet) `json:"-" yaml:"-"`

	// CustomParseFunc defines custom parse behaviour for structure, if CustomParseFunc is nil, default parse behaviour will be used
	CustomParseFunc func() (err error) `json:"-" yaml:"-"`
}

func (*HTTPS) BindFlags

func (https *HTTPS) BindFlags(fs *bootflag.FlagSet)

func (*HTTPS) GetIntPort

func (https *HTTPS) GetIntPort() (port int)

func (*HTTPS) Parse

func (https *HTTPS) Parse() (err error)

Jump to

Keyboard shortcuts

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