Ejemplo n.º 1
0
func NewAuthorizationCheck(logger log.Logger, dconf *distconf.Distconf, auth Authentication, tk timekeeper.TimeKeeper) *AuthorizationCheck {
	return &AuthorizationCheck{
		Logger:     logger,
		AlwaysAuth: dconf.Bool("a.bool", false),
		Auth:       auth,
		Tk:         tk,
	}
}
Ejemplo n.º 2
0
func NewServer(mux *http.ServeMux, dconf *distconf.Distconf, logger log.Logger, authCheck *AuthorizationCheck) *Server {
	return &Server{
		Port:      int(dconf.Int("a.b", 5788).Get()),
		Mux:       mux,
		Timeout:   dconf.Duration("a.c", time.Second).Get(),
		Logger:    logger,
		AuthCheck: authCheck,
	}
}