Documentation
¶
Index ¶
- Variables
- func Colorize(color, message string) string
- func ElapsedTime(ctx context.Context, action string)
- func FetchCommits(repository *git.Repository, info *hook.Info, hookType string) (commitIter object.CommitIter, err error)
- func GetRequestID(ctx context.Context) string
- func GetStartTime(ctx context.Context) time.Time
- func GetUserID(ctx context.Context) string
- func InitializeContext() context.Context
- func ItemExists(arrayType interface{}, item interface{}) bool
- func LoadRepository(ctx context.Context, options *config.Options) (*git.Repository, error)
- func ParseGitPushOptions()
- func PrintBanner(ctx context.Context, options *config.Options) error
- func PrintMessage(message string)
- func RevList(repository *git.Repository, info *hook.Info) (object.CommitIter, error)
- type ConcurrentSliceItem
- type ContextKey
- type ContextValues
- type HTTPClient
- type RevListOptions
- type Set
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Green ANSI Escape Code Green = "\033[32m" // Red ANSI Escape Code Red = "\033[31m" // Reset ANSI Escape Code Reset = "\033[0m" // Yellow ANSI Escape Code Yellow = "\033[33m" )
Functions ¶
func ElapsedTime ¶
ElapsedTime log task elapsed time
func FetchCommits ¶
func FetchCommits(repository *git.Repository, info *hook.Info, hookType string) (commitIter object.CommitIter, err error)
FetchCommits fetching commits
func GetRequestID ¶
GetRequestID will get requestID from a git push
func InitializeContext ¶
InitializeContext initialize context
func ItemExists ¶
func ItemExists(arrayType interface{}, item interface{}) bool
ItemExists check if an element exists in array
func LoadRepository ¶
LoadRepository load git repository
func PrintBanner ¶
PrintBanner Print watchdog banner
Types ¶
type ConcurrentSliceItem ¶
type ConcurrentSliceItem struct { Index int Value interface{} }
ConcurrentSliceItem Concurrent slice item
type ContextKey ¶
type ContextKey string
ContextKey is used for context.Context value. The value requires a key that is not primitive type.
const ( // ContextKeyRequestID is the ContextKey for RequestID ContextKeyRequestID ContextKey = "requestID" // ContextKeyStartTime is the ContextKey for UserID ContextKeyStartTime ContextKey = "startTime" // ContextKeyUserID is the ContextKey for UserID ContextKeyUserID ContextKey = "userId" // ContextKeyValues is the ContextKey for all values ContextKeyValues ContextKey = "contextValues" )
type ContextValues ¶
type ContextValues struct {
ValuesMap map[ContextKey]interface{}
}
ContextValues context values
func (ContextValues) Get ¶
func (values ContextValues) Get(key ContextKey) interface{}
Get return value for given key
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
HTTPClient data structure
func CreateHTTPClient ¶
func CreateHTTPClient(httpClient *http.Client, baseURL string) (*HTTPClient, error)
CreateHTTPClient create new http client
func (*HTTPClient) CreateRequest ¶
func (client *HTTPClient) CreateRequest(method string, endpointURL string, body io.Reader) (*http.Request, error)
CreateRequest create raw request
type RevListOptions ¶
type RevListOptions struct { // OldRev is the first reference hash to link OldRev plumbing.Hash // NewRev is the second reference hash to link NewRev plumbing.Hash }
RevListOptions defines the rules of rev-list func
Click to show internal directories.
Click to hide internal directories.