af8cab3d74
This eases adoption of the jobspec package by other projects (e.g. terraform nomad provider, Lavant). Either by consuming directy as a library (hopefully without having go mod import rest of nomad) or by copying the package without modification. Ideally, this package will be published as an independent module. We aren't ready for that considering we'll be switching to HCLv2 "soon", but eitherway, this seems like a reasonable intermediate step if we choose to.
25 lines
494 B
Go
25 lines
494 B
Go
package jobspec
|
|
|
|
// These functions are copied from helper/funcs.go
|
|
// added here to avoid jobspec depending on any other package
|
|
|
|
// intToPtr returns the pointer to an int
|
|
func intToPtr(i int) *int {
|
|
return &i
|
|
}
|
|
|
|
// int8ToPtr returns the pointer to an int8
|
|
func int8ToPtr(i int8) *int8 {
|
|
return &i
|
|
}
|
|
|
|
// int64ToPtr returns the pointer to an int
|
|
func int64ToPtr(i int64) *int64 {
|
|
return &i
|
|
}
|
|
|
|
// Uint64ToPtr returns the pointer to an uint64
|
|
func uint64ToPtr(u uint64) *uint64 {
|
|
return &u
|
|
}
|