// Code generated by "enumer -type=LogFormat -trimprefix=LogFormat -text -linecomment -transform=snake"; DO NOT EDIT. package instrumentation import ( "fmt" "strings" ) const _LogFormatName = "disabledtextjsongcpgcp_error_reporting" var _LogFormatIndex = [...]uint8{0, 0, 8, 12, 16, 19, 38} const _LogFormatLowerName = "disabledtextjsongcpgcp_error_reporting" func (i LogFormat) String() string { if i < 0 || i >= LogFormat(len(_LogFormatIndex)-1) { return fmt.Sprintf("LogFormat(%d)", i) } return _LogFormatName[_LogFormatIndex[i]:_LogFormatIndex[i+1]] } // An "invalid array index" compiler error signifies that the constant values have changed. // Re-run the stringer command to generate them again. func _LogFormatNoOp() { var x [1]struct{} _ = x[LogFormatUnspecified-(0)] _ = x[LogFormatDisabled-(1)] _ = x[LogFormatText-(2)] _ = x[LogFormatJSON-(3)] _ = x[LogFormatGCP-(4)] _ = x[LogFormatGCPErrorReporting-(5)] } var _LogFormatValues = []LogFormat{LogFormatUnspecified, LogFormatDisabled, LogFormatText, LogFormatJSON, LogFormatGCP, LogFormatGCPErrorReporting} var _LogFormatNameToValueMap = map[string]LogFormat{ _LogFormatName[0:0]: LogFormatUnspecified, _LogFormatLowerName[0:0]: LogFormatUnspecified, _LogFormatName[0:8]: LogFormatDisabled, _LogFormatLowerName[0:8]: LogFormatDisabled, _LogFormatName[8:12]: LogFormatText, _LogFormatLowerName[8:12]: LogFormatText, _LogFormatName[12:16]: LogFormatJSON, _LogFormatLowerName[12:16]: LogFormatJSON, _LogFormatName[16:19]: LogFormatGCP, _LogFormatLowerName[16:19]: LogFormatGCP, _LogFormatName[19:38]: LogFormatGCPErrorReporting, _LogFormatLowerName[19:38]: LogFormatGCPErrorReporting, } var _LogFormatNames = []string{ _LogFormatName[0:0], _LogFormatName[0:8], _LogFormatName[8:12], _LogFormatName[12:16], _LogFormatName[16:19], _LogFormatName[19:38], } // LogFormatString retrieves an enum value from the enum constants string name. // Throws an error if the param is not part of the enum. func LogFormatString(s string) (LogFormat, error) { if val, ok := _LogFormatNameToValueMap[s]; ok { return val, nil } if val, ok := _LogFormatNameToValueMap[strings.ToLower(s)]; ok { return val, nil } return 0, fmt.Errorf("%s does not belong to LogFormat values", s) } // LogFormatValues returns all values of the enum func LogFormatValues() []LogFormat { return _LogFormatValues } // LogFormatStrings returns a slice of all String values of the enum func LogFormatStrings() []string { strs := make([]string, len(_LogFormatNames)) copy(strs, _LogFormatNames) return strs } // IsALogFormat returns "true" if the value is listed in the enum definition. "false" otherwise func (i LogFormat) IsALogFormat() bool { for _, v := range _LogFormatValues { if i == v { return true } } return false } // MarshalText implements the encoding.TextMarshaler interface for LogFormat func (i LogFormat) MarshalText() ([]byte, error) { return []byte(i.String()), nil } // UnmarshalText implements the encoding.TextUnmarshaler interface for LogFormat func (i *LogFormat) UnmarshalText(text []byte) error { var err error *i, err = LogFormatString(string(text)) return err }