types

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 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

func SyncBranchSetting added in v1.7.0

func SyncBranchSetting(master, dev, test BranchTyp)

SyncBranchSetting reset builtin branch enums manually.

Types

type BranchSetting added in v1.7.0

type BranchSetting struct {
	Master, Dev, Test BranchTyp
}

BranchSetting contains some personal setting of git branch.

type BranchTyp

type BranchTyp string

BranchTyp is builtin branch type to limit parameter passing

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

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

func (BranchTyp) String

func (b BranchTyp) String() string

type Config

type Config struct {
	OAuth  *OAuth         `toml:"oauth"`
	Branch *BranchSetting `toml:"branch"`

	GitlabAPIURL string `toml:"gitlab_api_url"`
	GitlabHost   string `toml:"gitlab_host"`
	DebugMode    bool   `toml:"debug"`
	OpenBrowser  bool   `toml:"open_browser"`
}

Config contains all fields can be specified by user.

func (Config) Valid

func (cfg Config) Valid() error

Valid validates config is valid to use.

type FlowContext

type FlowContext struct {
	// contains filtered or unexported fields
}

FlowContext contains all necessary parameters of flow command to execute. SHOULD NOT export context attributes to another package.

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) APIEndpoint added in v1.7.0

func (c *FlowContext) APIEndpoint() string

func (*FlowContext) CWD

func (c *FlowContext) CWD() string

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) GetOAuth added in v1.7.0

func (c *FlowContext) GetOAuth() *OAuth

func (*FlowContext) InjectProject added in v1.7.0

func (c *FlowContext) InjectProject(p *ProjectBasics)

func (*FlowContext) IsDebug added in v1.7.0

func (c *FlowContext) IsDebug() bool

func (*FlowContext) Project

func (c *FlowContext) Project() *ProjectBasics

func (*FlowContext) ProjectName added in v1.6.0

func (c *FlowContext) ProjectName() string

ProjectName return project name.

func (*FlowContext) ShouldOpenBrowser added in v1.7.0

func (c *FlowContext) ShouldOpenBrowser() bool

type OAuth added in v1.7.0

type OAuth struct {
	AccessToken  string `toml:"access_token"`
	RefreshToken string `toml:"refresh_token"`
}

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

	// ParseIssueCompatible if this is true, means parse issueName to feature in compatible way.
	ParseIssueCompatible bool
}

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