Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// MaxReqSize defines the maximum request size in bytes
MaxReqSize uint64
// MaxFileSize defines the maximum file size in bytes
MaxFileSize uint64
// MaxMultipartMembuf defines the maximum multipart/form-data memory buffer
MaxMultipartMembuf uint64
}
App represents the application configurations
type Config ¶
type Config struct {
Mode Mode
TransportHTTP *TransportHTTP
DebugLog *log.Logger
ErrorLog *log.Logger
App App
}
Config defines the API server configurations
type Duration ¶
Duration represents a duration
func (*Duration) UnmarshalTOML ¶
UnmarshalTOML implements the TOML unmarshaler interface
type File ¶
type File struct {
Mode Mode `toml:"mode"`
Log struct {
Debug string `toml:"debug"`
Error string `toml:"error"`
} `toml:"log"`
TransportHTTP struct {
Host string `toml:"host"`
KeepAliveDuration Duration `toml:"keep-alive-duration"`
TLS struct {
Enabled bool `toml:"enabled"`
MinVersion TLSVersion `toml:"min-version"`
CertificateFile string `toml:"certificate-file"`
KeyFile string `toml:"key-file"`
CurvePreferences []TLSCurveID `toml:"curve-preferences"`
CipherSuites []TLSCipherSuite `toml:"cipher-suites"`
} `toml:"tls"`
} `toml:"transport-http"`
App struct {
MaxReqSize string `toml:"max-req-size"`
MaxFileSize string `toml:"max-file-size"`
MaxMultipartMembuf string `toml:"max-multipart-membuf"`
} `toml:"app"`
}
File represents a TOML encoded configuration file
type TLSCipherSuite ¶
type TLSCipherSuite uint16
TLSCipherSuite represents a TLS cipher suite
func (*TLSCipherSuite) UnmarshalTOML ¶
func (v *TLSCipherSuite) UnmarshalTOML(val interface{}) error
UnmarshalTOML implements the TOML unmarshaler interface
type TLSCurveID ¶
TLSCurveID represents a TLS curve identifier
func (*TLSCurveID) UnmarshalTOML ¶
func (v *TLSCurveID) UnmarshalTOML(val interface{}) error
UnmarshalTOML implements the TOML unmarshaler interface
type TLSVersion ¶
type TLSVersion uint16
TLSVersion represents a TLS protocol version
func (*TLSVersion) UnmarshalTOML ¶
func (v *TLSVersion) UnmarshalTOML(val interface{}) error
UnmarshalTOML implements the TOML unmarshaler interface
type TransportHTTP ¶
type TransportHTTP struct {
Host string
KeepAliveDuration time.Duration
TLS *TransportHTTPTLS
}
TransportHTTP defines the HTTP server transport layer configurations
func (*TransportHTTP) Init ¶
func (conf *TransportHTTP) Init() error
Init sets defaults and validates the configurations
type TransportHTTPTLS ¶
type TransportHTTPTLS struct {
Config *tls.Config
CertificateFilePath string
PrivateKeyFilePath string
}
TransportHTTPTLS represents the TLS configurations
func (*TransportHTTPTLS) Clone ¶
func (stls *TransportHTTPTLS) Clone() *TransportHTTPTLS
Clone creates an exact detached copy of the server TLS configurations