uitls

package
v0.0.0-...-0eee5d1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: Apache-2.0 Imports: 7 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 Info

func Info(format string, args ...interface{})

Info should be used to describe the example commands that are about to run.

func MustReadFile

func MustReadFile(path string) []byte

MustReadFile read a file based on a given path and return an array of bytes

func RemoveContents

func RemoveContents(dir string) error

RemoveContents remove all folders of a given dir except docs folder

func RunCommand

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

RunCommand run a linux command

func Warning

func Warning(format string, args ...interface{})

Warning should be used to display a warning

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"`
}

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