Documentation ¶
Index ¶
- func AuthIsBearer(authType string) bool
- func ExtractAuthorizationInfo(r *http.Request, header string) (authType string, authInfo string)
- func ExtractTokenFromRequest(r *http.Request) (string, bool)
- func JSONResponse(w http.ResponseWriter, closure func() (interface{}, error))
- func WriteData(w http.ResponseWriter, data []byte)
- func WriteJsonError(w http.ResponseWriter, err error)
- type CertMaster
- type CertMasterOpts
- type DomainConfig
- type Issuer
- type IssuerOpts
- type Middleware
- type Option
- type SSLConfig
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthIsBearer ¶ added in v0.3.8
func ExtractAuthorizationInfo ¶ added in v0.3.8
func JSONResponse ¶
func JSONResponse(w http.ResponseWriter, closure func() (interface{}, error))
JSONResponse calls the closure and respond with data or error. If no error, but the interface is nil it will write "OK" to the response writer.
func WriteData ¶
func WriteData(w http.ResponseWriter, data []byte)
func WriteJsonError ¶
func WriteJsonError(w http.ResponseWriter, err error)
Types ¶
type CertMaster ¶ added in v0.3.7
type CertMaster struct {
// contains filtered or unexported fields
}
func NewCertMaster ¶ added in v0.3.7
func NewCertMaster(opts *CertMasterOpts) (*CertMaster, error)
func (*CertMaster) GetCertificate ¶ added in v0.3.7
func (m *CertMaster) GetCertificate(h *tls.ClientHelloInfo) (*tls.Certificate, error)
func (*CertMaster) Running ¶ added in v0.3.7
func (m *CertMaster) Running() bool
func (*CertMaster) Shutdown ¶ added in v0.3.7
func (m *CertMaster) Shutdown() error
type CertMasterOpts ¶ added in v0.3.7
type DomainConfig ¶
type DomainConfig struct { Mode string `yaml:"mode" valid:"required"` PrimaryName string `yaml:"name" valid:"dns,required"` ExtraNames []string `yaml:"extra_names,omitempty" valid:"dns"` IssueSSL bool `yaml:"issue_ssl,omitempty"` Schema string `yaml:"schema,omitempty"` Email string `yaml:"email,omitempty" valid:"email"` // Dir to store cached certificates, use sub-directory of cfgDir if possible. Dir string `yaml:"dir,omitempty" valid:"path"` }
DomainConfig is the YAML version of the `adminAPI.DomainConfig` struct.
func (*DomainConfig) Validate ¶
func (c *DomainConfig) Validate() error
type Issuer ¶
type Issuer struct {
// contains filtered or unexported fields
}
Issuer should be named like certManager
func NewIssuer ¶
func NewIssuer(opts *IssuerOpts) (*Issuer, error)
func (*Issuer) GetCertificate ¶ added in v0.3.7
func (is *Issuer) GetCertificate(domain string) *tls.Certificate
type IssuerOpts ¶
type Option ¶
type Option func(w *Server)
func WithDisableHTTPv2 ¶ added in v0.3.8
func WithDisableHTTPv2() Option
func WithLogger ¶
func WithLogger() Option
func WithMetrics ¶
func WithMetrics() Option
func WithMiddleware ¶
func WithMiddleware(mw Middleware) Option
type SSLConfig ¶
type SSLConfig struct { // ListenAddr for HTTPS server, default: ":443" ListenAddr string `yaml:"listen_addr" valid:"listen_addr,required"` }
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewDefault ¶
func NewDefault() *Server
func NewDefaultSSL ¶
func NewRedirectToSSL ¶
func (*Server) Router ¶
func (w *Server) Router() chi.Router
Router exposes chi.Router for the external registration of handlers. usage:
h.Router().Get("/apt/path", myHandler) h.Router().Post("/apt/verb", myOtherHandler)
Click to show internal directories.
Click to hide internal directories.