common

package
v0.0.0-...-f2350e3 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogJson

func LogJson(v interface{})

func PanicOnError

func PanicOnError(err error)

PanicOnError if err != nil log.Panic

func ReplacePlaceholder

func ReplacePlaceholder(value string) string

ReplacePlaceholder ...

func SanitizeName

func SanitizeName(value string) string

SanitizeName will check for whitespaces. if exist will break the string into componenets and merge it back as camelCase eg. "Some test string" => "someTestString"

Types

type FakerOptions

type FakerOptions struct {
	Email           string `faker:"email"`
	PhoneNumber     string `faker:"phone_number"`
	URL             string `faker:"url"`
	UserName        string `faker:"username"`
	TitleMale       string `faker:"title_male"`
	TitleFemale     string `faker:"title_female"`
	FirstName       string `faker:"first_name"`
	FirstNameMale   string `faker:"first_name_male"`
	FirstNameFemale string `faker:"first_name_female"`
	LastName        string `faker:"last_name"`
	Name            string `faker:"name"`
	Date            string `faker:"date"`
	Time            string `faker:"time"`
	MonthName       string `faker:"month_name"`
	Year            string `faker:"year"`
	DayOfWeek       string `faker:"day_of_week"`
	DayOfMonth      string `faker:"day_of_month"`
	Timestamp       string `faker:"timestamp"`
	Century         string `faker:"century"`
	TimeZone        string `faker:"timezone"`
	TimePeriod      string `faker:"time_period"`
	Word            string `faker:"word"`
	Sentence        string `faker:"sentence"`
	Paragraph       string `faker:"paragraph"`
	Currency        string `faker:"currency"`
	UUID            string `faker:"uuid_digit"`
}

type NameData

type NameData struct {
	Location    string `json:"location"`
	Maintainer  string `json:"maintainer"`
	ProjectName string `json:"project_name"`
}

func ExtractNameData

func ExtractNameData(fullname string) *NameData

ExtractNameData will break fullname into parts by / Part 0 will be platform (eg. github.com) Part 1 will be maintainer (er. AkronimBlack) Part 3 and everything after it fill be joined back by / and be set as project name

Jump to

Keyboard shortcuts

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