2019-02-19 23:56:41 +00:00
|
|
|
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
|
|
|
// Use of this source code is governed by the Drone Non-Commercial License
|
|
|
|
// that can be found in the LICENSE file.
|
|
|
|
|
2019-03-13 21:47:47 +00:00
|
|
|
// +build !oss
|
|
|
|
|
2019-02-19 23:56:41 +00:00
|
|
|
package system
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/drone/drone/core"
|
|
|
|
"github.com/drone/drone/handler/api/render"
|
|
|
|
)
|
|
|
|
|
|
|
|
// HandleLicense returns an http.HandlerFunc that writes
|
|
|
|
// json-encoded license details to the response body.
|
|
|
|
func HandleLicense(license core.License) http.HandlerFunc {
|
|
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
|
|
|
render.JSON(w, license, 200)
|
|
|
|
}
|
|
|
|
}
|