common

package
v3.2.1-beta+incompatible Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name        = "gitrob"
	Version     = "3.2.1-beta"
	ASCIIBanner = "        _ __           __\n" +
		"  ___ _(_) /________  / /\n" +
		" / _ `/ / __/ __/ _ \\/ _ \\\n" +
		" \\_, /_/\\__/_/  \\___/_.__/\n" +
		"/___/ by @michenriksen & @codeEmitter"
)
View Source
const (
	FATAL     = 5
	ERROR     = 4
	WARN      = 3
	IMPORTANT = 2
	INFO      = 1
	DEBUG     = 0
)
View Source
const (
	TargetTypeUser         = "User"
	TargetTypeOrganization = "Organization"
)
View Source
const (
	EmptyTreeCommitId = "4b825dc642cb6eb9a060e54bf8d69288fbee4904"
)
View Source
const GitLabTanuki = "\n" +
	"      //               //     \n" +
	"     ////             ////    \n" +
	"    //////           //////   \n" +
	"   ((((((((/////////((((((((  \n" +
	"   ((((((((////////(((((((((  \n" +
	"  ((((((((((///////(((((((((( \n" +
	"     ((((((((/////((((((((    \n" +
	"         (((((///(((((        \n" +
	"            (((/(((           \n" +
	"               *              \n" +
	"        GitLab Red Team       \n" +
	"\n"

Variables

View Source
var NewlineRegex = regexp.MustCompile(`\r?\n`)
View Source
var UserAgent = fmt.Sprintf("%s v%s", Name, Version)

Functions

func CleanUrlSpaces

func CleanUrlSpaces(dirtyStrings ...string) []string

func FileExists

func FileExists(path string) bool

func GetChangeAction

func GetChangeAction(change *object.Change) string

func GetChangeContent

func GetChangeContent(change *object.Change) (result string, contentError error)

func GetChangePath

func GetChangePath(change *object.Change) string

func GetChanges

func GetChanges(commit *object.Commit, repo *git.Repository) (object.Changes, error)

func GetRepositoryHistory

func GetRepositoryHistory(repository *git.Repository) ([]*object.Commit, error)

func Pluralize

func Pluralize(count int, singular string, plural string) string

func TruncateString

func TruncateString(str string, maxLength int) string

Types

type CloneConfiguration

type CloneConfiguration struct {
	InMemClone *bool
	Url        *string
	Username   *string
	Token      *string
	Branch     *string
	Depth      *int
}

type IClient

type IClient interface {
	GetUserOrOrganization(login string) (*Owner, error)
	GetRepositoriesFromOwner(target Owner) ([]*Repository, error)
	GetOrganizationMembers(target Owner) ([]*Owner, error)
}

type Logger

type Logger struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*Logger) Debug

func (l *Logger) Debug(format string, args ...interface{})

func (*Logger) Error

func (l *Logger) Error(format string, args ...interface{})

func (*Logger) Fatal

func (l *Logger) Fatal(format string, args ...interface{})

func (*Logger) Important

func (l *Logger) Important(format string, args ...interface{})

func (*Logger) Info

func (l *Logger) Info(format string, args ...interface{})

func (*Logger) Log

func (l *Logger) Log(level int, format string, args ...interface{})

func (*Logger) SetDebug

func (l *Logger) SetDebug(d bool)

func (*Logger) SetSilent

func (l *Logger) SetSilent(s bool)

func (*Logger) Warn

func (l *Logger) Warn(format string, args ...interface{})

type Owner

type Owner struct {
	Login     *string
	ID        *int64
	Type      *string
	Name      *string
	AvatarURL *string
	URL       *string
	Company   *string
	Blog      *string
	Location  *string
	Email     *string
	Bio       *string
}

type Repository

type Repository struct {
	Owner         *string
	ID            *int64
	Name          *string
	FullName      *string
	CloneURL      *string
	URL           *string
	DefaultBranch *string
	Description   *string
	Homepage      *string
}

Jump to

Keyboard shortcuts

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