Documentation ¶
Index ¶
- Constants
- Variables
- func BuildArtifacts(w http.ResponseWriter, r *http.Request)
- func BuildPurge(r *http.Request)
- func BuildRawLog(w http.ResponseWriter, r *http.Request)
- func BuildStageLog(w http.ResponseWriter, r *http.Request)
- func DeleteAll(r *mux.Router, path string, ref interface{}, success func(*http.Request)) error
- func GetCookie(r *http.Request, name string) (string, error)
- func InvalidateCookie(path, name string) *http.Cookie
- func JsonBody(r *http.Request) (*jsonq.JsonQuery, error)
- func Jsonify(w http.ResponseWriter, v interface{})
- func Login(w http.ResponseWriter, r *http.Request)
- func Logout(w http.ResponseWriter, r *http.Request)
- func NoCaching(w http.ResponseWriter)
- func ProjectBadge(w http.ResponseWriter, r *http.Request)
- func ProjectLatestBuild(w http.ResponseWriter, r *http.Request)
- func ProjectList(w http.ResponseWriter, r *http.Request)
- func ProjectTrigger(w http.ResponseWriter, r *http.Request)
- func ProjectUpdate(r *http.Request)
- func QueryAll(router *mux.Router, path string, ref interface{}, flags ...int) error
- func QueryOne(r *mux.Router, path string, ref interface{}) error
- func ServeFile(w http.ResponseWriter, path string, contentType string)
- func UpdateOne(r *mux.Router, path string, ref interface{}, success func(*http.Request)) error
Constants ¶
const ( // Time the session cookie should be valid when remember // me option is used during login. SESSION_TIMEOUT_REMEBERME = 7 * 24 * time.Hour SESSION_TIMEOUT_NORMAL = 15 * time.Minute )
const ( // groups GROUP_QUERYALL = "queryall" GROUP_QUERYONE = "one" // custom headerfields HEADER_TIMESTAMP = "X-Timestamp" // HTTP GET query parameters for paging GET_QUERY_LIMIT = "limit" GET_QUERY_SKIP = "skip" // flags QUERY_REVERSE = iota )
const ( CONTENT_TYPE_JSON = "application/json" CONTENT_TYPE_SVG = "image/svg+xml" CONTENT_TYPE_TEXT = "text/plain" CONTENT_TYPE_STREAM = "application/octet-stream" )
const (
TOKEN_QUERY_NAME = "token"
)
Variables ¶
var (
ErrEmptyJson = errors.New("empty json object")
)
var (
ErrInvalidRef = errors.New("ref must be struct or slice")
)
var (
Fs http.FileSystem
)
Functions ¶
func BuildArtifacts ¶
func BuildArtifacts(w http.ResponseWriter, r *http.Request)
Gets the tar.gz archive of the build artifacts.
func BuildPurge ¶
Callback when build history purging was successfull.
func BuildRawLog ¶
func BuildRawLog(w http.ResponseWriter, r *http.Request)
Gets the whole raw log of a build.
func BuildStageLog ¶
func BuildStageLog(w http.ResponseWriter, r *http.Request)
Gets the raw log of a specific stage of a build.
func InvalidateCookie ¶
Invalidates the given cookie.
func Jsonify ¶
func Jsonify(w http.ResponseWriter, v interface{})
Writes the JSON representation of v to the supplied http.ResposeWriter. If an error occours while marshalling the object the http response will be an internal server error.
func Login ¶
func Login(w http.ResponseWriter, r *http.Request)
Try to login the user with provided credentials.
func NoCaching ¶
func NoCaching(w http.ResponseWriter)
Applies necessary headers to disable caching.
func ProjectBadge ¶
func ProjectBadge(w http.ResponseWriter, r *http.Request)
Badge (failing / passing) for the project.
func ProjectLatestBuild ¶
func ProjectLatestBuild(w http.ResponseWriter, r *http.Request)
Queries on project by its id.
func ProjectList ¶
func ProjectList(w http.ResponseWriter, r *http.Request)
Gets the project short list.
func ProjectTrigger ¶
func ProjectTrigger(w http.ResponseWriter, r *http.Request)
func QueryAll ¶
Queries all entries by one ore more fields. The entries are matched against the url routing parameters.
func QueryOne ¶
Queries just on entry by one ore more fields. The entries are matched against the url routing parameters.
Types ¶
This section is empty.