Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrReadConfigFile = fmt.Errorf("failed to read rules config file") ErrParseConfigFile = fmt.Errorf("failed to parse rules config file") )
custom errors.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
Handler struct.
func (*Handler) GetImportRules ¶
GetImportRules loads config file (import path mapping rules)
func (*Handler) ReloadRules ¶
func (h *Handler) ReloadRules(w http.ResponseWriter, r *http.Request)
ReloadRules is the handler that reloads mapping rules from config.
func (*Handler) VanityServer ¶
func (h *Handler) VanityServer(w http.ResponseWriter, r *http.Request)
VanityServer redirects browsers to godoc or go tool to VCS repository.
type Option ¶
type Option func(*Options)
Option type
func WithConfigFile ¶
WithConfigFile sets the config file path.
func WithGodocURL ¶
WithGodocURL sets the redirect URL for godoc.
type Options ¶
Options struct
func NewOptions ¶
NewOptions returns a new set of options for the http handler.
Click to show internal directories.
Click to hide internal directories.