Documentation
¶
Index ¶
- Variables
- func Assert(expected interface{}, actual interface{}) error
- func HTTPLoggerGetRequestID(r *http.Request) string
- func MockRoundTripperQueue(t *testing.T, queue []MockRoundTripFunc) http.RoundTripper
- func RespondHTML(w http.ResponseWriter, status int, s string)
- func RespondJSON(w http.ResponseWriter, status int, v interface{})
- func Run(ctx context.Context, app WebApp) error
- func SetValueInEnvFile(filePath, key string, value string)
- func UnreachableError(err error)
- type App
- type AssertFailure
- type Environment
- type HTTPClient
- type HTTPClientInterceptor
- type HTTPLogger
- type HTTPRouter
- type HTTPStatic
- type Log
- type Logger
- type LoggerJSON
- func (logger *LoggerJSON) Alert(message string, context map[string]interface{})
- func (logger *LoggerJSON) Critical(message string, context map[string]interface{})
- func (logger *LoggerJSON) Debug(message string, context map[string]interface{})
- func (logger *LoggerJSON) Emergency(message string, context map[string]interface{})
- func (logger *LoggerJSON) Error(message string, context map[string]interface{})
- func (logger *LoggerJSON) Info(message string, context map[string]interface{})
- func (logger *LoggerJSON) Notice(message string, context map[string]interface{})
- func (logger *LoggerJSON) StandardLogger() *log.Logger
- func (logger *LoggerJSON) Warning(message string, context map[string]interface{})
- func (logger *LoggerJSON) Write(b []byte) (int, error)
- type MockRoundTripFunc
- type MockableRoundTripper
- type Resources
- type Runtime
- type WebApp
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidValue returned when the value passed to Unmarshal is nil or not a pointer to a struct. ErrInvalidValue = errors.New("value must be a non-nil pointer to a struct") // ErrUnsupportedFieldType returned when a field with tag "env" is unsupported. ErrUnsupportedFieldType = errors.New("field is an unsupported type") // ErrUnexportedField returned when a field with tag "env" is not exported. ErrUnexportedField = errors.New("field must be exported") )
Functions ¶
func HTTPLoggerGetRequestID ¶
HTTPLoggerGetRequestID gets the request ID off of the request if there is one
func MockRoundTripperQueue ¶ added in v0.0.3
func MockRoundTripperQueue(t *testing.T, queue []MockRoundTripFunc) http.RoundTripper
func RespondHTML ¶
func RespondHTML(w http.ResponseWriter, status int, s string)
func RespondJSON ¶
func RespondJSON(w http.ResponseWriter, status int, v interface{})
func SetValueInEnvFile ¶ added in v0.0.4
func UnreachableError ¶
func UnreachableError(err error)
Types ¶
type AssertFailure ¶
type AssertFailure struct {
Expected interface{}
Actual interface{}
}
type Environment ¶
func NewEnvironment ¶
func NewEnvironment() Environment
func (Environment) Decode ¶
func (env Environment) Decode(target interface{}) error
func (Environment) ImportEnvFileContents ¶
func (environment Environment) ImportEnvFileContents(fileContents string) error
type HTTPClient ¶ added in v0.0.4
type HTTPClient struct {
// contains filtered or unexported fields
}
func NewHTTPClient ¶ added in v0.0.4
func NewHTTPClient( interceptor HTTPClientInterceptor, client *http.Client, ) *HTTPClient
type HTTPClientInterceptor ¶ added in v0.0.4
type HTTPLogger ¶
func (*HTTPLogger) ServeHTTP ¶
func (httpLogger *HTTPLogger) ServeHTTP(w http.ResponseWriter, r *http.Request)
type HTTPRouter ¶
func (*HTTPRouter) ServeHTTP ¶
func (httpRouter *HTTPRouter) ServeHTTP(w http.ResponseWriter, r *http.Request)
type HTTPStatic ¶
type HTTPStatic struct {
FileSystem http.FileSystem
NotFoundHandler http.Handler
CacheControl string
}
func HTTPSpaHandler ¶
func HTTPSpaHandler(fileSystem http.FileSystem, entryPoint string, headerChanger func(http.Header)) *HTTPStatic
func (*HTTPStatic) ServeHTTP ¶
func (httpStatic *HTTPStatic) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Logger ¶
type Logger interface {
Emergency(message string, context map[string]interface{})
Alert(message string, context map[string]interface{})
Critical(message string, context map[string]interface{})
Error(message string, context map[string]interface{})
Warning(message string, context map[string]interface{})
Notice(message string, context map[string]interface{})
Info(message string, context map[string]interface{})
Debug(message string, context map[string]interface{})
StandardLogger() *log.Logger
}
type LoggerJSON ¶
func (*LoggerJSON) Alert ¶
func (logger *LoggerJSON) Alert(message string, context map[string]interface{})
func (*LoggerJSON) Critical ¶
func (logger *LoggerJSON) Critical(message string, context map[string]interface{})
func (*LoggerJSON) Debug ¶
func (logger *LoggerJSON) Debug(message string, context map[string]interface{})
func (*LoggerJSON) Emergency ¶
func (logger *LoggerJSON) Emergency(message string, context map[string]interface{})
func (*LoggerJSON) Error ¶
func (logger *LoggerJSON) Error(message string, context map[string]interface{})
func (*LoggerJSON) Info ¶
func (logger *LoggerJSON) Info(message string, context map[string]interface{})
func (*LoggerJSON) Notice ¶
func (logger *LoggerJSON) Notice(message string, context map[string]interface{})
func (*LoggerJSON) StandardLogger ¶
func (logger *LoggerJSON) StandardLogger() *log.Logger
func (*LoggerJSON) Warning ¶
func (logger *LoggerJSON) Warning(message string, context map[string]interface{})
type MockRoundTripFunc ¶ added in v0.0.3
type MockableRoundTripper ¶
type Runtime ¶
type Runtime struct {
Environment Environment
Stdout io.Writer
Stderr io.Writer
Stdin io.Reader
FS fs.FS
}
func NewRuntime ¶
func NewRuntime() *Runtime
func (Runtime) ReadInDefaultEnvironmentFiles ¶
func (Runtime) ReadInEnvironmentFile ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.