utils

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultConfigFile = ".mr-tracker.yml"

Variables

View Source
var (
	RequestVersion bool
	Settings       UserSettings
)

Functions

func CheckSettings

func CheckSettings() error

TODO

func FormRequest

func FormRequest(url string, params url.Values) string

func Get

func Get(url string) ([]byte, int)

func ParseTime

func ParseTime(time_str string) (t time.Time, err error)

func PathExists added in v0.1.0

func PathExists(path string) bool

func Post

func Post(url string, jsonData []byte) []byte

func PrintVersion

func PrintVersion()

func ReadFile added in v0.1.0

func ReadFile(filepath string) []byte

read whole file content

func Write2File added in v0.1.1

func Write2File(changes string, file string) error

Types

type UserSettings

type UserSettings struct {
	Site      string `yaml:"site,omitempty"`
	Project   int    `yaml:"project,omitempty"`
	Branch    string `yaml:"branch,omitempty"`
	StartTag  string `yaml:"start_tag,omitempty"`
	EndTag    string `yaml:"end_tag,omitempty"`
	PostIssue bool   `yaml:"post_issue,omitempty"`
	Token     string `yaml:"token,omitempty"`
	Output    string `yaml:"output,omitempty"`
	Simplify  bool   `yaml:"simplify,omitempty"`
}

Settings from command line

func LoadSettings added in v0.1.0

func LoadSettings() (UserSettings, error)

Jump to

Keyboard shortcuts

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