types

package
v1.6.6 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyAccessToken = errors.New("empty access token")
	ErrEmptyGitlabAPI   = errors.New("empty gitlab API URL")
)

Functions

This section is empty.

Types

type BranchTyp

type BranchTyp string

BranchTyp is builtin branch type to limit parameter passing

var (
	MasterBranch BranchTyp = "master"
	DevBranch    BranchTyp = "develop"
	TestBranch   BranchTyp = "test"
)

TODO(@yeqown) MasterBranch, DevBranch and TestBranch could be customized.

func (BranchTyp) String

func (b BranchTyp) String() string

type Config

type Config struct {
	AccessToken  string `toml:"access_token"`
	DebugMode    bool   `toml:"debug"`
	GitlabAPIURL string `toml:"gitlab_api_url"`
	OpenBrowser  bool   `toml:"open_browser"`
}

Config contains all fields can be specified by user.

func (*Config) Apply added in v1.6.0

func (cfg *Config) Apply(debug, openBrowser bool) *Config

Apply open debug in Config if debug is true, otherwise do nothing.

func (Config) Valid

func (cfg Config) Valid() error

Valid validates config is valid to use.

type FlowContext

type FlowContext struct {
	// Conf of flow CLI.
	Conf *Config

	// CWD current working directory.
	CWD string

	// Project of current working directory, normally,
	// get from current working directory.
	Project *ProjectBasics
	// contains filtered or unexported fields
}

FlowContext contains all necessary parameters of flow command to execute.

func NewContext

func NewContext(cwd, confPath, projectName string, c *Config, forceRemote bool) *FlowContext

NewContext be generated with non project information. Do not use Project directly!!!

func (*FlowContext) ConfPath

func (c *FlowContext) ConfPath() string

ConfPath return configuration path

func (*FlowContext) ForceRemote added in v1.6.2

func (c *FlowContext) ForceRemote() bool

ForceRemote return should module need to locate project by projectName from remote. true means locate project from remote, false means do not jump the process of locating project from local.

func (*FlowContext) ProjectName added in v1.6.0

func (c *FlowContext) ProjectName() string

ProjectName return project name.

type OpFeatureContext added in v1.6.4

type OpFeatureContext struct {
	// ForceCreateMergeRequest if this is true, means merge request would be create no matter whether
	// merge request has been created or merged.
	ForceCreateMergeRequest bool
	// FeatureBranchName specify which branch name to use in the lifecycle of feature operations.
	FeatureBranchName string
}

OpFeatureContext contains all parameters of features' operations in common.

type ProjectBasics

type ProjectBasics struct {
	ID     int
	Name   string
	WebURL string
}

ProjectBasics contains basic attributes of project.

Jump to

Keyboard shortcuts

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