Documentation
¶
Index ¶
- Variables
- func Run() error
- type DebugServer
- type Option
- func WithColor(b bool) Option
- func WithHMACHeaderName(s string) Option
- func WithHMACSecret(s string) Option
- func WithIdleTimeout(dur time.Duration) Option
- func WithListenAddr(addr string) Option
- func WithOutputWriter(s string) Option
- func WithRawHTTPRequestFileSaveFormat(s string) Option
- func WithReadHeaderTimeout(dur time.Duration) Option
- func WithReadTimeout(dur time.Duration) Option
- func WithSaveRawHTTPRequest(b bool) Option
- func WithSecretToken(s string) Option
- func WithSecretTokenHeaderName(s string) Option
- func WithWriteTimeout(dur time.Duration) Option
- type VerboseServer
Constants ¶
This section is empty.
Variables ¶
var (
ErrValueRequired = errors.New("value required")
)
sentinel errors.
Functions ¶
Types ¶
type DebugServer ¶
type DebugServer struct { HTTPServer *http.Server OutputWriter io.WriteCloser ListenAddr string HMACSecret string HMACHeaderName string RawHTTPRequestFileSaveFormat string SecretToken string SecretTokenHeaderName string ReadTimeout time.Duration ReadHeaderTimeout time.Duration WriteTimeout time.Duration IdleTimeout time.Duration Color bool SaveRawHTTPRequest bool }
DebugServer represents server/handler args.
func New ¶
func New(options ...Option) (*DebugServer, error)
New instantiates new http server instance.
type Option ¶
type Option func(*DebugServer)
Option represents option function type.
func WithHMACHeaderName ¶
WithHMACHeaderName sets HMAC header name value, will check this http header name in request header.
func WithIdleTimeout ¶
WithIdleTimeout sets http server's idle timeout.
func WithOutputWriter ¶
WithOutputWriter sets output, where to write incoming webhook.
func WithRawHTTPRequestFileSaveFormat ¶
WithRawHTTPRequestFileSaveFormat set file save name format for raw http request.
func WithReadHeaderTimeout ¶
WithReadHeaderTimeout sets http server's read header timeout.
func WithReadTimeout ¶
WithReadTimeout sets http server's read timeout.
func WithSaveRawHTTPRequest ¶
WithSaveRawHTTPRequest enables/disables saving raw http request to disk.
func WithSecretToken ¶ added in v0.3.4
WithSecretToken sets the secret value for secret token.
func WithSecretTokenHeaderName ¶ added in v0.3.4
WithSecretTokenHeaderName sets secret token header name value, will check this http header name in request header.
func WithWriteTimeout ¶
WithWriteTimeout sets http server's write timeout.
type VerboseServer ¶
VerboseServer defines server behaviours.