http

package
v0.0.0-...-98b2a73 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*http.Client
	Domain string
}

func (*Client) Dial

func (c *Client) Dial(ctx context.Context, cfg ClientConfig) error

type ClientConfig

type ClientConfig struct {
	Domain string `json:"domain" env:"HTTP_CLIENT_DOMAIN"`
}

ClientConfig is http service config.

type Config

type Config struct {
	Hostname      string   `json:"hostname" env:"HTTP_HOSTNAME" env-default:"0.0.0.0"`
	Port          string   `json:"port" env:"HTTP_PORT" env-default:"8080"`
	AllowedCORS   []string `json:"allowed_cors" env:"HTTP_ALLOWED_CORS"`
	HostWhitelist []string `json:"host_whitelist" env:"HTTP_HOST_WHITELIST"`
	Cert          string   `json:"cert" env:"HTTP_CERT"`
	Key           string   `json:"key" env:"HTTP_KEY"`
	CSR           string   `json:"csr" env:"HTTP_CSR"`
	Insecure      bool     `json:"insecure" env:"HTTP_INSECURE"`
}

Config is http service config.

type ErrInvalidClaim

type ErrInvalidClaim struct {
	Claim string
}

func (ErrInvalidClaim) Error

func (e ErrInvalidClaim) Error() string

type ErrInvalidStatus

type ErrInvalidStatus struct {
	Status string
}

func (ErrInvalidStatus) Error

func (e ErrInvalidStatus) Error() string

type Service

type Service struct {
	*http.Server
	*mux.Router
}

Service embed a http server.

func (*Service) Close

func (s *Service) Close(ctx context.Context) error

func (*Service) Dial

func (s *Service) Dial(ctx context.Context, cfg Config) error

Dial connects http server.

Jump to

Keyboard shortcuts

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