rcpersist

package
v0.0.0-...-a71d288 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SCMPortalTypeGitHub    SCMPortalType = "github"
	SCMPortalTypeGitLab    SCMPortalType = "gitlab"
	CESTypeGitHubRunner    CESType       = "github_runner"
	CESTypeGitLabRunner    CESType       = "gitlab_runner"
	CESTypeJenkinsPipeline CESType       = "jenkins_pipeline"
	CESTypeLoMa            CESType       = "locally_manually"
)

Variables

View Source
var (
	ErrRcFileNotExists = fmt.Errorf("rc file does not exist. please connect first")
	ErrNotInGitIgnore  = fmt.Errorf("warn: please add %s to your %s or secrets may be exposed", rcFileName, ignoreFileName)
)

Functions

func RemoveRcFile

func RemoveRcFile()

Types

type CESType

type CESType string

type ConnectCredentials

type ConnectCredentials struct {
	ServerUrl  string  `yaml:"server_url"`
	Repository string  `yaml:"repository"`
	Token      Token   `yaml:"token"`
	TokenPlain *string `yaml:"tplain,omitempty"`
}

type RcFile

type RcFile struct {
	ConnectCreds  ConnectCredentials
	CESType       CESType
	SCMPortalType SCMPortalType
}

func NewRcInstance

func NewRcInstance() *RcFile

func (*RcFile) Exists

func (rc *RcFile) Exists() bool

func (*RcFile) Load

func (rc *RcFile) Load() (creds *ConnectCredentials, err error)

func (*RcFile) Save

func (rc *RcFile) Save() (err error)

func (*RcFile) UpdateCESType

func (rc *RcFile) UpdateCESType(cesType CESType)

func (*RcFile) UpdateCreds

func (rc *RcFile) UpdateCreds(server string, repo string, token string) error

func (*RcFile) UpdateSCMPortalType

func (rc *RcFile) UpdateSCMPortalType(scmPortalType SCMPortalType)

type SCMPortalType

type SCMPortalType string

type Token

type Token string

func (Token) Decrypt

func (t Token) Decrypt() (string, error)

func (Token) Encrypt

func (t Token) Encrypt() (string, error)

func (Token) ToString

func (t Token) ToString() string

Jump to

Keyboard shortcuts

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