utils

package
v0.0.0-...-9c90d3e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTokenErrResponse

func GetTokenErrResponse(c *gin.Context, err error)

GetTokenErrResponse sets proper api err response for given err

Types

type ContextData

type ContextData struct {
	*core.UserData
	RepoName        string `validate:"repo"`
	OrgName         string `validate:"org"`
	RepoID          string
	OrgID           string
	ExecID          string    `validate:"exec_id"`
	IntervalType    string    `validate:"type"`
	StartDate       time.Time `validate:"start_date"`
	EndDate         time.Time `validate:"end_date"`
	Limit           int
	Offset          int
	NextCursor      string
	TaskID          string `validate:"task_id"`
	BuildID         string `validate:"build_id"`
	LogsTag         string `validate:"logs_tag"`
	GitProviderType string `validate:"git_provider"`
}

ContextData represent the data added to gin context from query paramse

func ExtractAndValidateData

func ExtractAndValidateData(c *gin.Context, requiredParams map[string]struct{}, paginationRequired bool) (*ContextData, int, error)

ExtractAndValidateData returns and validates the incoming data in context if it exists.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL