{"modulePath":"github.com/bep/execrpc","version":"v0.10.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package codecs\n\n## Variables\n\n```go\nvar ErrUnknownCodec = errors.New(\"unknown codec\")\n```\nErrUnknownCodec is returned when no codec is found for the given name.\n\n## Types\n\n```go\ntype Codec interface {\n\tEncode(any) ([]byte, error)\n\tDecode([]byte, any) error\n\tName() string\n}\n```\nCodec defines the interface for a two way conversion between Q and R.\n\n```go\nfunc ForName(name string) (Codec, error)\n```\nForName returns the codec for the given name or ErrUnknownCodec if no codec is found.\n\n```go\ntype JSONCodec struct{}\n```\nJSONCodec is a Codec that uses JSON as the underlying format.\n\n```go\nfunc (c JSONCodec) Decode(b []byte, r any) error\n```\n\n```go\nfunc (c JSONCodec) Encode(q any) ([]byte, error)\n```\n\n```go\nfunc (c JSONCodec) Name() string\n```\n\n```go\ntype TOMLCodec struct{}\n```\nTOMLCodec is a Codec that uses TOML as the underlying format.\n\n```go\nfunc (c TOMLCodec) Decode(b []byte, r any) error\n```\n\n```go\nfunc (c TOMLCodec) Encode(q any) ([]byte, error)\n```\n\n```go\nfunc (c TOMLCodec) Name() string\n```\n\n","path":"github.com/bep/execrpc/codecs","name":"codecs","synopsis":"","isRedistributable":true}
