git

package
v0.0.0-...-79b970a Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateWebhook

func CreateWebhook(url string, gc *GitClient) error

func DeleteRepository

func DeleteRepository(name string, gc *GitClient) error

func DisonnectRepository

func DisonnectRepository(gc *GitClient)

Types

type GitClient

type GitClient struct {
	Owner      string
	Repository *github.Repository
	Client     *github.Client
	Token      string
	Email      string
}

func NewGitClient

func NewGitClient(owner, email, token string) *GitClient

func (*GitClient) ConnectRepository

func (c *GitClient) ConnectRepository(repo string) error

func (*GitClient) CreateFile

func (c *GitClient) CreateFile(file GitFile, project string) error

func (*GitClient) CreateFilesByFiletype

func (c *GitClient) CreateFilesByFiletype(username, email, namespace, filename string, content []byte, filetype GitFileType) (*github.Response, error)

func (*GitClient) CreateGitWebhook

func (c *GitClient) CreateGitWebhook(url string) error

func (*GitClient) CreateRepository

func (c *GitClient) CreateRepository(name string, private bool) error

func (*GitClient) DeleteFile

func (c *GitClient) DeleteFile(file GitFile) error

func (*GitClient) GetFilesByPath

func (c *GitClient) GetFilesByPath(path string) []string

func (*GitClient) GetRepositoryCloneURL

func (c *GitClient) GetRepositoryCloneURL() string

func (*GitClient) Listfile

func (c *GitClient) Listfile(dir, username string) []string

func (*GitClient) UpdateFile

func (c *GitClient) UpdateFile(m map[GitFile]GitFile) error

m is map[NewFile]OldFile

type GitDockerFile

type GitDockerFile struct {
	Username string `json:"username"`
	Content  string `json:"content"`
	Image    string `json:"image"`
}

type GitFile

type GitFile interface {
	// contains filtered or unexported methods
}

type GitFileType

type GitFileType string
const (
	CI       GitFileType = "ci"
	CD       GitFileType = "cd"
	Docker   GitFileType = "docker"
	Manifest GitFileType = "manifest"
)

type GitManifest

type GitManifest struct {
	Username string `json:"username"`
	Content  string `json:"content"`
	Filename string `json:"filename"`
}

Jump to

Keyboard shortcuts

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