Documentation ¶
Index ¶
- Constants
- Variables
- func CreateTracer(serviceName string) (io.Closer, error)
- func IsOwnerRepo(repoName string) bool
- func IsSHA(sha string) bool
- func JSONContext(ctx *gin.Context, parameter string, obj interface{}) error
- func JSONIO(from, to interface{}) error
- func OwnerRepo(repoName string) (string, string, error)
- func QualifyBranch(branch string) (string, error)
- func ScopePagination(pg, ppg string) (int64, int64, error)
- func ScopePaginationInt(page, perPage int64) (int64, int64, error)
- func SetUpGRPCTracing(client string) (io.Closer, []grpc.DialOption, error)
- func WrapError(err error, message string, args ...interface{}) error
Constants ¶
const MaxPerPage int64 = 100
MaxPerPage is the maximum size of a single page that tinyCI will generate when rendering responses.
Variables ¶
var ( // ErrNotFound is a generic error for things that don't exist. ErrNotFound = errors.New("not found") // ErrInvalidAuth is for authentication events that do not succeed. ErrInvalidAuth = errors.New("invalid authentication") // ErrRunCanceled is thrown to github when the run is canceled. ErrRunCanceled = errors.New("run canceled by user intervention") )
var ( //ErrInvalidCharacters occurs when one of "%><$." is found in either Owner or repo ErrInvalidCharacters = errors.New("repository name contains invalid characters") )
Functions ¶
func CreateTracer ¶
CreateTracer creates an opentracing-compatible jaegertracing client.
func IsOwnerRepo ¶
IsOwnerRepo is a predicate to determine whether or not a github repo name is valid.
func JSONContext ¶
JSONContext provides an easy method to extract json from gin parameters.
func JSONIO ¶
func JSONIO(from, to interface{}) error
JSONIO is a copy function that uses JSON as an intermediary.
func OwnerRepo ¶
OwnerRepo returns the owner and repository parts of a github full repository name. It returns an error if there are issues.
func QualifyBranch ¶
QualifyBranch corrects branch data to reflect our internal ref-type/ref-name strategy for tracking branches. It returns an error when it can't figure it out.
func ScopePagination ¶
ScopePagination applies constraints to pagination; it sets a maximum and a default if not supplied to perPage. String version.
func ScopePaginationInt ¶
ScopePaginationInt applies constraints to pagination; it sets a maximum and a default if not supplied to perPage. Integer-only version.
func SetUpGRPCTracing ¶
SetUpGRPCTracing configures grpc dial functions for tracing.
Types ¶
This section is empty.