Documentation ¶
Overview ¶
Package common provides implementation of general interest for certain sub packages of Inago.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ExtExp = regexp.MustCompile(`(?m)\.[a-z]*$`)
ExtExp matches unit file extensions.
app@1.service => .service app@1.mount => .mount app.service => .service app.mount => .mount
Functions ¶
func SliceID ¶
SliceID takes a unit file name and returns its slice ID.
Example ¶
ExampleSliceID is an example of the SliceID function.
for _, input := range []string{ "app@1.service", "app@1.mount", "app.service", "app.mount", } { id, _ := SliceID(input) fmt.Println(id) }
Output: 1 1
func UnitBase ¶
UnitBase returns the base of the unit name. The base is considered everything up to the @ character, if any, or the given name without extension.
Example ¶
ExampleUnitBase is an example of the UnitBase function.
for _, input := range []string{ "app@1.service", "app@1.mount", "app.service", "app.mount", } { fmt.Println(UnitBase(input)) }
Output: app app app app
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.