router

package
v0.0.0-...-b137acd Latest Latest
Warning

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

Go to latest
Published: May 28, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOCAL_DIR  = "/tmp/data"
	GIT_ORIGIN = "https://github.com/qjw/test.git"
	SWAGGER_UI = "/tmp/swagger_ui"
	FRONTEND   = "/tmp/frontend"
	PORT       = 8888

	GITLAB_TOKEN = ""
)

Variables

This section is empty.

Functions

func CheckIfError

func CheckIfError(err error)

func GetEnv

func GetEnv(key, fallback string) string

func GetEnvInt

func GetEnvInt(key string, fallback int) int

func Init

func Init(repository *git.Repository, r kelly.Router, config *Config)

func RemoveContents

func RemoveContents(dir string) error

Types

type Commit

type Commit struct {
	Name  string `json:"name"`
	Email string `json:"email"`
	Log   string `json:"log"`
	Hash  string `json:"hash"`
	Time  string `json:"time"`
}

type Config

type Config struct {
	LocalDir string `json:"localDir"`
	// 如果不存在,则不从远程Clone
	GitOrigin string `json:"gitOrigin"`
	SwaggetUi string `json:"swaggerUI"`
	Frontend  string `json:"frontend"`
	Port      int    `json:"port"`

	// gitlab/github hook
	GitlabToken string `json:"gitlabToken"`
}

func InitConfig

func InitConfig() *Config

type Current

type Current struct {
	Global
}

type GitlabHookNotify

type GitlabHookNotify struct {
	ObjectKind string `json:"object_kind"`

	// push event
	EventName         string `json:"event_name,omitempty"`
	Ref               string `json:"ref,omitempty"`
	CheckoutSha       string `json:"checkout_sha,omitempty"`
	TotalCommitsCount int    `json:"total_commits_count,omitempty"`
	Name              string `json:"user_name,omitempty"`
	Email             string `json:"user_email,omitempty"`
	AvatarUrl         string `json:"user_avatar,omitempty"`

	User User `json:"user"`
}

type Global

type Global struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	Company     string `json:"company"`
}

type Spec

type Spec struct {
	Groups []struct {
		Name        string `json:"name"`
		Description string `json:"description"`
		Projects    []struct {
			Name        string `json:"name"`
			Description string `json:"description"`
			Spec        string `json:"spec"`
		} `json:"projects"`
	} `json:"groups"`
	Global
}

type User

type User struct {
	Name   string `json:"name"`
	Avatar string `json:"avatar"`
}

Jump to

Keyboard shortcuts

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