utils

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GitClone

func GitClone(url string, target string) error

func IsRoot

func IsRoot(filepath string) bool

func Max

func Max(a, b int) int

func Min

func Min(a, b int) int

func ReadJson

func ReadJson(filepath string, v interface{}) error

func RenderString

func RenderString(templateString string, funcMap template.FuncMap) (string, error)

func ResolvePath

func ResolvePath(filepath string) (string, error)

Types

type GitClient

type GitClient struct {
	// contains filtered or unexported fields
}

func NewGitClient

func NewGitClient(repo string) *GitClient

func (*GitClient) Config

func (gc *GitClient) Config(name string) (string, error)

func (*GitClient) GetCurrentVersion

func (gc *GitClient) GetCurrentVersion() string

getCurrentVersion determines the current version for non-local git extensions.

func (*GitClient) GetLatestVersion

func (gc *GitClient) GetLatestVersion() (string, error)

func (*GitClient) GetOrigin

func (gc *GitClient) GetOrigin() string

func (*GitClient) Pull

func (gc *GitClient) Pull() error

type RestClient

type RestClient struct {
	// contains filtered or unexported fields
}

func NewGHClient

func NewGHClient(host string) RestClient

func (RestClient) Do

func (c RestClient) Do(method string, path string, body io.Reader, response interface{}) error

func (RestClient) DoWithContext

func (c RestClient) DoWithContext(ctx context.Context, method string, path string, body io.Reader, response interface{}) error

func (RestClient) Get

func (c RestClient) Get(path string, resp interface{}) error

Jump to

Keyboard shortcuts

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