mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-05 07:45:27 -04:00
Document exported funcs,types,interfaces and enable check. (#475)
* Include EXC0014 and fix issues. * Include EXC0012 and fix issues. Signed-off-by: Fabian Kammel <fk@edgeless.systems> Co-authored-by: Otto Bittner <cobittner@posteo.net>
This commit is contained in:
parent
c9873f2bfb
commit
0d12e37c96
74 changed files with 337 additions and 78 deletions
|
@ -16,6 +16,7 @@ import (
|
|||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
// Server provides measurements.
|
||||
type Server struct {
|
||||
log *logger.Logger
|
||||
server http.Server
|
||||
|
@ -23,6 +24,7 @@ type Server struct {
|
|||
done chan<- struct{}
|
||||
}
|
||||
|
||||
// New creates a new Server.
|
||||
func New(log *logger.Logger, done chan<- struct{}) *Server {
|
||||
return &Server{
|
||||
log: log,
|
||||
|
@ -30,6 +32,7 @@ func New(log *logger.Logger, done chan<- struct{}) *Server {
|
|||
}
|
||||
}
|
||||
|
||||
// ListenAndServe on given port.
|
||||
func (s *Server) ListenAndServe(port string) error {
|
||||
mux := http.NewServeMux()
|
||||
mux.Handle("/pcrs", http.HandlerFunc(s.logPCRs))
|
||||
|
@ -46,6 +49,7 @@ func (s *Server) ListenAndServe(port string) error {
|
|||
return s.server.Serve(lis)
|
||||
}
|
||||
|
||||
// Shutdown server.
|
||||
func (s *Server) Shutdown() error {
|
||||
return s.server.Shutdown(context.Background())
|
||||
}
|
||||
|
@ -84,6 +88,7 @@ func (s *Server) logPCRs(w http.ResponseWriter, r *http.Request) {
|
|||
s.done <- struct{}{}
|
||||
}
|
||||
|
||||
// GetMeasurements returns the static measurements for QEMU environment.
|
||||
func (s *Server) GetMeasurements() map[uint32][]byte {
|
||||
return s.measurements
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue