lib

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GitApiFromRemote

func GitApiFromRemote[T gitapi.GitApiInfo](remoteP *Remote, info T) *gitapi.GitApi[T]

Return a GitApi pointer base on Remote

Types

type ConfSecret

type ConfSecret struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

func (*ConfSecret) Encrypt

func (secretP *ConfSecret) Encrypt(pubkeyP *gitapi.RepoPublicKey) *gitapi.RepoEncryptedPair

type ConfSecrets

type ConfSecrets []ConfSecret

func (*ConfSecrets) Has

func (secretsP *ConfSecrets) Has(name *string) bool

type Groups

type Groups []string

func (*Groups) Add

func (groupsP *Groups) Add(groupP *string)

func (*Groups) Get

func (groupsP *Groups) Get(name string) *string

func (*Groups) Has

func (groupsP *Groups) Has(groupP *string) bool

type Remote

type Remote struct {
	Name  string `json:"name"`
	Group string `json:"group"`
	Ssh   string `json:"ssh"`

	Entrypoint string `json:"entrypoint"` // Api entrypoint url
	Token      string `json:"token"`      // Api token
	User       string `json:"user"`       // Api user
	Private    bool   `json:"private"`    // Default private vaule
	Vendor     string `json:"vendor"`     // Api vendor/brand
}

func (*Remote) GitAdd

func (self *Remote) GitAdd() *helper.MyCmd

Add all Remotes into git repository

func (*Remote) GitRemove

func (self *Remote) GitRemove() *helper.MyCmd

Remove all Remotes in git repository

type Remotes

type Remotes []Remote

Array of Remote

func (*Remotes) Add

func (self *Remotes) Add(rP *Remote)

Add Remote

func (*Remotes) AddArray

func (self *Remotes) AddArray(raP *Remotes)

Add Remote Array

func (*Remotes) Get

func (self *Remotes) Get(nameP *string) *Remote

Get Remote by name

func (*Remotes) GetByGroup

func (self *Remotes) GetByGroup(groupP *string) *Remotes

Get all Remote in a group

func (*Remotes) Has

func (self *Remotes) Has(name *string) bool

Check array has Remote (by name)

type TypeConf

type TypeConf struct {
	File          string       `json:"-"`
	Groups        Groups       `json:"-"`
	Remotes       Remotes      `json:"remotes"`
	Secrets       []ConfSecret `json:"secrets"`
	MergedRemotes Remotes      `json:"-"`
}

func (*TypeConf) Init

func (c *TypeConf) Init(flag *TypeFlag)

func (*TypeConf) MergeRemotes

func (c *TypeConf) MergeRemotes(flag *TypeFlag)

Calculate remotes base on flag

type TypeFlag

type TypeFlag struct {
	Debug      bool
	Groups     []string
	PushAll    bool
	PushBranch []string
	PushTag    bool
	Remotes    []string
}

Jump to

Keyboard shortcuts

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