1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-16 04:24:56 +02:00

transport/message/encoder.go: Define the Encoder type

This commit is contained in:
Henrik Hautakoski 2023-02-10 16:42:58 +01:00
parent 38ae3a4630
commit 2c3af6e4c5

View file

@ -6,6 +6,9 @@ import (
log "github.com/sirupsen/logrus"
)
// Encoder is a function that can encode a object to the encoded format.
type Encoder func(v any) ([]byte, error)
func Encode(v interface{}) ([]byte, bool) {
payload, err := json.Marshal(v)
if err != nil {