Documentation ¶
Index ¶
- Constants
- func Comment(g *ast.CommentGroup) string
- func FullTypeName(x reflect.Type) string
- func JSONIsNativePath(x any) bool
- func JSONListFromSerializer[A any](x []A, serialize func(x A) ([]byte, error)) ([]byte, error)
- func JSONMapFromSerializer[K comparable, A any](x map[K]A, serialize func(x A) ([]byte, error)) ([]byte, error)
- func JSONMarshal[A any](x any) ([]byte, error)
- func JSONMarshalMap[T1, T2 any](k T1, v T2) (string, json.RawMessage, error)
- func JSONMarshallerRegister[A any](fullName string, from func([]byte) (A, error), to func(A) ([]byte, error))
- func JSONParseList(x []byte, onElement func(index int, value []byte) error) error
- func JSONParseObject(x []byte, onElement func(key string, value []byte) error) error
- func JSONToListWithDeserializer[A any](x []byte, _ []A, deserialize func(value []byte) (A, error)) ([]A, error)
- func JSONToMapWithDeserializer[K comparable, A any](x []byte, _ map[K]A, deserialize func(value []byte) (A, error)) (map[K]A, error)
- func JSONUnmarshal[A any](data []byte) (A, error)
- func JSONUnmarshalMap[T1, T2 any](key string, value json.RawMessage) (T1, T2, error)
- func TypeRegistryLoad(typeFullName string) (any, bool)
- func TypeRegistryLoadFromReflect(x reflect.Type) (any, bool)
Constants ¶
View Source
const Program = "mkunion"
Variables ¶
This section is empty.
Functions ¶
func Comment ¶
func Comment(g *ast.CommentGroup) string
Comment implementation was copied from func (g *CommentGroup) Text() string and reduced return all comments lines. In contrast to original implementation that skips declaration comments like "//go:generate" which is important for inferring union types.
func FullTypeName ¶ added in v1.21.0
func JSONIsNativePath ¶ added in v1.21.0
func JSONListFromSerializer ¶ added in v1.20.1
func JSONMapFromSerializer ¶ added in v1.20.1
func JSONMarshalMap ¶ added in v1.21.0
func JSONMarshalMap[T1, T2 any](k T1, v T2) (string, json.RawMessage, error)
func JSONMarshallerRegister ¶ added in v1.21.0
func JSONParseList ¶ added in v1.21.0
func JSONParseObject ¶ added in v1.20.1
func JSONToListWithDeserializer ¶ added in v1.20.1
func JSONToMapWithDeserializer ¶ added in v1.20.1
func JSONUnmarshal ¶ added in v1.21.0
func JSONUnmarshalMap ¶ added in v1.21.0
func JSONUnmarshalMap[T1, T2 any](key string, value json.RawMessage) (T1, T2, error)
func TypeRegistryLoad ¶ added in v1.21.0
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.