utils

package
v0.0.0-...-15fa497 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientSet

func ClientSet(kubeConfigPath string) *kubernetes.Clientset

func ExtractJson

func ExtractJson(value interface{}, s string) (interface{}, error)

func GetFileContent

func GetFileContent(client *github.Client, file *github.CommitFile, owner, repo string) (string, error)

func GetPullRequestFiles

func GetPullRequestFiles(client *github.Client, o, r string, n int) ([]*github.CommitFile, *github.Response, error)

ListFiles retrieves a list of commit files for each pull request in a GitHub repository. It takes a GitHub client and a context as input parameters. It returns a slice of commit files, and an error if any.

func GitHubClient

func GitHubClient(token string) *github.Client

func NamespaceConfigMaps

func NamespaceConfigMaps(clientset *kubernetes.Clientset) ([]*v1.ConfigMapList, error)

func SelectFile

func SelectFile(pull int, file *github.CommitFile) *github.CommitFile

Types

type ConfigMaps

type ConfigMaps struct {
	Title     string `json:"title"`
	Namespace string `json:"namespace"`
	UID       string `json:"uid"`
}

type JSON

type JSON struct {
	UID string `json:"uid"`
}

type YAML

type YAML struct {
	APIVersion string `yaml:"apiVersion"`
	Kind       string `yaml:"kind"`
	Metadata   struct {
		Name      string `yaml:"name"`
		Namespace string `yaml:"namespace"`
		Labels    struct {
			GrafanaDashboard string `yaml:"grafana_dashboard"`
		} `yaml:"labels"`
	} `yaml:"metadata"`
	Data map[string]interface{} `yaml:"data"`
}

func ExtractYaml

func ExtractYaml(decodeContent string) (*YAML, error)

Jump to

Keyboard shortcuts

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