uitls

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckArgs

func CheckArgs(arg ...string)

CheckArgs should be used to ensure the right command line arguments are passed before executing an example.

func CheckIfError

func CheckIfError(err error)

CheckIfError should be used to naively panics if an error is not nil.

func CreateDir

func CreateDir(path string)

CreateDir creates a dir based on a given path

func Download

func Download(url string) ([]byte, error)

Download Downloads a file.

func RemoveCode

func RemoveCode(dir string) error

RemoveCode remove all folders of a given dir except docs folder

func RunCommand

func RunCommand(name string, args ...string)

RunCommand run a linux command

Types

type DocsConfig

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

DocsConfig config data structure for config yaml file parser

func NewDocsConfig

func NewDocsConfig(fileName string) *DocsConfig

NewDocsConfig returns an instance of DocsConfig data structure

func (*DocsConfig) GetDocsYamlConfig

func (c *DocsConfig) GetDocsYamlConfig() DocsYamlConfig

GetDocsYamlConfig return the docs yaml config data structure

func (*DocsConfig) Parse

func (c *DocsConfig) Parse() error

Parse parse a yaml config file

type DocsYamlConfig

type DocsYamlConfig struct {
	Versions []struct {
		Ver   string `yaml:"ver"`
		Repos []struct {
			Name    string `yaml:"name"`
			URL     string `yaml:"url"`
			TagName string `yaml:"tagName"`
		} `yaml:"repos"`
	} `yaml:"versions"`
	LatestVersion string `yaml:"LatestVersion"`
}

DocsYamlConfig corresponding golang structure for a versions yaml file

Jump to

Keyboard shortcuts

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