type Value … // ValueOf returns a Value initialized with the concrete value stored in v. // This panics if the type does not match one of the allowed types in the // Value union. func ValueOf(v any) Value { … } // ValueOfBool returns a new boolean value. func ValueOfBool(v bool) Value { … } // ValueOfInt32 returns a new int32 value. func ValueOfInt32(v int32) Value { … } // ValueOfInt64 returns a new int64 value. func ValueOfInt64(v int64) Value { … } // ValueOfUint32 returns a new uint32 value. func ValueOfUint32(v uint32) Value { … } // ValueOfUint64 returns a new uint64 value. func ValueOfUint64(v uint64) Value { … } // ValueOfFloat32 returns a new float32 value. func ValueOfFloat32(v float32) Value { … } // ValueOfFloat64 returns a new float64 value. func ValueOfFloat64(v float64) Value { … } // ValueOfString returns a new string value. func ValueOfString(v string) Value { … } // ValueOfBytes returns a new bytes value. func ValueOfBytes(v []byte) Value { … } // ValueOfEnum returns a new enum value. func ValueOfEnum(v EnumNumber) Value { … } // ValueOfMessage returns a new Message value. func ValueOfMessage(v Message) Value { … } // ValueOfList returns a new List value. func ValueOfList(v List) Value { … } // ValueOfMap returns a new Map value. func ValueOfMap(v Map) Value { … } // IsValid reports whether v is populated with a value. func (v Value) IsValid() bool { … } // Interface returns v as an any. // // Invariant: v == ValueOf(v).Interface() func (v Value) Interface() any { … } func (v Value) typeName() string { … } func (v Value) panicMessage(what string) string { … } // Bool returns v as a bool and panics if the type is not a bool. func (v Value) Bool() bool { … } // Int returns v as a int64 and panics if the type is not a int32 or int64. func (v Value) Int() int64 { … } // Uint returns v as a uint64 and panics if the type is not a uint32 or uint64. func (v Value) Uint() uint64 { … } // Float returns v as a float64 and panics if the type is not a float32 or float64. func (v Value) Float() float64 { … } // String returns v as a string. Since this method implements [fmt.Stringer], // this returns the formatted string value for any non-string type. func (v Value) String() string { … } // Bytes returns v as a []byte and panics if the type is not a []byte. func (v Value) Bytes() []byte { … } // Enum returns v as a [EnumNumber] and panics if the type is not a [EnumNumber]. func (v Value) Enum() EnumNumber { … } // Message returns v as a [Message] and panics if the type is not a [Message]. func (v Value) Message() Message { … } // List returns v as a [List] and panics if the type is not a [List]. func (v Value) List() List { … } // Map returns v as a [Map] and panics if the type is not a [Map]. func (v Value) Map() Map { … } // MapKey returns v as a [MapKey] and panics for invalid [MapKey] types. func (v Value) MapKey() MapKey { … } type MapKey … // IsValid reports whether k is populated with a value. func (k MapKey) IsValid() bool { … } // Interface returns k as an any. func (k MapKey) Interface() any { … } // Bool returns k as a bool and panics if the type is not a bool. func (k MapKey) Bool() bool { … } // Int returns k as a int64 and panics if the type is not a int32 or int64. func (k MapKey) Int() int64 { … } // Uint returns k as a uint64 and panics if the type is not a uint32 or uint64. func (k MapKey) Uint() uint64 { … } // String returns k as a string. Since this method implements [fmt.Stringer], // this returns the formatted string value for any non-string type. func (k MapKey) String() string { … } // Value returns k as a [Value]. func (k MapKey) Value() Value { … }