Documentation ¶
Index ¶
- Constants
- Variables
- func CreateService(serviceType int, scope ...string) (interface{}, error)
- func GminMessage(msgTxt string) string
- func Hostname() string
- func IPAddress() string
- func InputFromStdIn(inputFile string) (*bufio.Scanner, error)
- func IsErrRetryable(e error) bool
- func IsValidAttr(attr string, attrMap map[string]string) (string, error)
- func ParseForceSend(fStr string, attrMap map[string]string) ([]string, error)
- func ParseInputAttrs(jsonBytes []byte) ([]string, error)
- func ProcessHeader(hdr []interface{}) map[int]string
- func ShowAttrVals(attrSlice []string, filter string)
- func ShowAttrs(attrSlice []string, attrMap map[string]string, filter string)
- func ShowFlagValues(flagSlice []string, filter string)
- func ShowGlobalFlagValues(lenArgs int, args []string, filter string) error
- func ShowQueryableAttrs(filter string, qAttrMap map[string]string)
- func SliceContainsStr(strs []string, s string) bool
- func Timestamp() string
- func UniqueStrSlice(inSlice []string) []string
- func Username() string
- func ValidateHeader(hdr map[int]string, attrMap map[string]string) error
- func ValidateInputAttrs(attrs []string, attrMap map[string]string) error
- func ValidateRecoveryPhone(phoneNo string) error
- type EmptyValues
Constants ¶
const ( CALLTYPECREATE = iota CALLTYPEDELETE CALLTYPEMANAGE CALLTYPEMOVE CALLTYPEUNDELETE CALLTYPEUPDATE )
const ( OBJTYPECROSDEV = iota OBJTYPEGROUP OBJTYPEGRPSET OBJTYPEMEMBER OBJTYPEMOBDEV OBJTYPEORGUNIT OBJTYPEUSER )
const ( // SRVTYPEADMIN is used to request admin service SRVTYPEADMIN = iota // SRVTYPEGRPSETTING is used to request sheet service SRVTYPEGRPSETTING // SRVTYPESHEET is used to request sheet service SRVTYPESHEET )
const ( // QUIT is used for terminating commands QUIT int = 99 // TIMEFORMAT is used to format timestamp TIMEFORMAT string = "2006-01-02T15:04:05Z0700" )
Variables ¶
var Logger *zap.SugaredLogger
Logger passed from logging package
var ValidFileFormats = []string{
"csv",
"gsheet",
"json",
"text",
"txt",
}
ValidFileFormats provides valid file format strings
var ValidPrimaryShowArgs = []string{
"cdev",
"chromeos-device",
"cros-dev",
"cros-device",
"group",
"grp",
"group-alias",
"group-settings",
"grp-settings",
"grp-set",
"gsettings",
"gset",
"grp-alias",
"galias",
"ga",
"group-member",
"grp-member",
"grp-mem",
"gmember",
"gmem",
"mdev",
"mob-dev",
"mob-device",
"mobile-device",
"orgunit",
"ou",
"schema",
"sc",
"ua",
"ualias",
"user",
"user-alias",
"usr",
}
ValidPrimaryShowArgs holds valid primary arguments for the show command
var ValidSortOrders = map[string]string{
"asc": "ascending",
"ascending": "ascending",
"desc": "descending",
"descending": "descending",
}
ValidSortOrders provides valid sort order strings
Functions ¶
func CreateService ¶ added in v0.8.0
CreateService function creates and returns a service object
func GminMessage ¶ added in v0.7.0
GminMessage constructs a message for output
func IPAddress ¶ added in v0.8.0
func IPAddress() string
IPAddress gets IP address of machine if possible
func InputFromStdIn ¶ added in v0.6.0
InputFromStdIn checks to see if there is stdin data and sets up a scanner for it
func IsErrRetryable ¶ added in v0.7.0
IsErrRetryable checks to see whether Google API error should allow retry
func IsValidAttr ¶
IsValidAttr checks to see whether or not an attribute is valid
func ParseForceSend ¶ added in v0.5.0
ParseForceSend parses force send fields arguments
func ParseInputAttrs ¶ added in v0.5.0
ParseInputAttrs parses create and update JSON attribute strings
func ProcessHeader ¶ added in v0.7.0
ProcessHeader processes header column names
func ShowAttrVals ¶ added in v0.8.0
ShowAttrVals displays object attribute enumerated values or names of attributes that have them
func ShowFlagValues ¶ added in v0.8.0
ShowFlagValues displays enumerated flag values
func ShowGlobalFlagValues ¶ added in v0.8.0
ShowGlobalFlagValues displays enumerated global flag values
func ShowQueryableAttrs ¶ added in v0.6.0
ShowQueryableAttrs displays user queryable attributes
func SliceContainsStr ¶
SliceContainsStr tells whether a slice contains a particular string
func UniqueStrSlice ¶ added in v0.6.0
UniqueStrSlice takes a slice with duplicate values and returns one with unique values
func Username ¶ added in v0.8.0
func Username() string
Username gets username of current user if possible
func ValidateHeader ¶ added in v0.7.0
ValidateHeader validated header column names
func ValidateInputAttrs ¶ added in v0.5.0
ValidateInputAttrs validates JSON attribute string for create and update calls
func ValidateRecoveryPhone ¶ added in v0.7.0
ValidateRecoveryPhone validates recovery phone number
Types ¶
type EmptyValues ¶ added in v0.7.0
type EmptyValues struct {
ForceSendFields []string
}
EmptyValues is struct used to extract ForceSendFields from JSON