action_git

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

This is the workflow action for calling an api

Index

Constants

View Source
const (
	TARGET_TYPE_GITLAB = "gitlab"
	TARGET_TYPE_GITHUB = "github"
)

Variables

This section is empty.

Functions

func Action_GitDownload

func Action_GitDownload(w *workflow.Workflow, m *workflow.TemplateData) error

func GetSchema

func GetSchema() workflow.SchemaEndpoint

GetAction returns the action for the target

Types

type Git

type Git struct {
	Host          string `json:"host" yaml:"host" flag:"host h" desc:"the host url"`
	User          string `json:"user" yaml:"user" flag:"user u" desc:"The user name"`
	Authorization string `json:"authorization" yaml:"authorization" flag:"auth a" desc:"The auth token"`
	Ssh           string `json:"ssh" yaml:"ssh" flag:"ssh s" desc:"The SSH key"`
	Email         string `json:"email" yaml:"email" flag:"email e" desc:"The Email address"`
}

K8 is the struct for the k8 connection If you want to use the kube config file, you need to set the DefaultContext and ConfigPath DefaultContext is the default context to use ConfigPath is the path to the kube config file Host is the host to connect to You will need to set the Host and Authorization if you want to use the token connection Authorization is the authorization token UseTokenConnection if true, use the token connection, otherwise use the kube config file Ignore_ssl if true, ignore the ssl connection

func CreateGit

func CreateGit(host string, authorization string) (*Git, error)

Create a instance of the k8 type default_context is the default context to use config_path is the path to the kube config file

func CreateGitOptions

func CreateGitOptions(opts ...GitOption) (*Git, error)

CreateK8Options creates a instance of the k8 type opts are the options for the k8 type

func (*Git) DownloadFromGitHub

func (m *Git) DownloadFromGitHub(project string, File string, branch string) (string, error)

func (*Git) DownloadFromGitLab

func (m *Git) DownloadFromGitLab(project string, File string, branch string) (string, error)

func (*Git) DownloadGitFile

func (m *Git) DownloadGitFile(target_type string, project string, File string, branch string) (string, error)

func (*Git) String

func (m *Git) String() string

String returns the string representation of the k8 type

func (*Git) Update

func (m *Git) Update(opts ...GitOption)

Update the k8 Type with the options

type GitOption

type GitOption func(*Git)

K8Option is the option for the k8 connection

func OptionGitEmail

func OptionGitEmail(email string) GitOption

OptionK8IgnoreSSL is the option for the ignore ssl

func OptionGitHost

func OptionGitHost(host string) GitOption

OptionK8DefaultContext is the option for the default context

func OptionGitPassword

func OptionGitPassword(password string) GitOption

OptionK8Host is the option for the host

func OptionGitSSH

func OptionGitSSH(ssh string) GitOption

OptionK8Auth is the option for the authorization

func OptionGitUser

func OptionGitUser(user string) GitOption

OptionK8ConfigPath is the option for the config path

type GitSchema

type GitSchema struct {
}

func (GitSchema) GetActionSchema

func (s GitSchema) GetActionSchema() map[string]workflow.ActionSchema

GetActions returns the actions for this schema

func (GitSchema) GetFunctionMap

func (s GitSchema) GetFunctionMap() map[string]workflow.FunctionSchema

GetFunctionMap returns the function map for this schema

func (GitSchema) GetTargetSchema

func (s GitSchema) GetTargetSchema() map[string]workflow.TargetSchema

GetTargetSchema returns the target schema for this action

Jump to

Keyboard shortcuts

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