Skip to content
This repository has been archived by the owner on Dec 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #14 from pulsejet/varun/doc-fields
Browse files Browse the repository at this point in the history
doc: add fields interface description
  • Loading branch information
zjkmxy authored Dec 19, 2024
2 parents bbb142e + c5b7489 commit e287432
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions pkg/encoding/codegen/fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,38 @@ type TlvField interface {

// codegen encoding length of the field
// - in(value): struct being encoded
// - in(encoder): encoder struct
// - out(l): length variable to update
GenEncodingLength() (string, error)
// codegen encoding length for nocopy
GenEncodingWirePlan() (string, error)
// codegen encoding the field
// - in(value): struct being encoded
// - out(buf): buffer to write to
GenEncodeInto() (string, error)
// codegen fields in encoder struct
GenEncoderStruct() (string, error)
// codegen encoder initialization
// - in(value): struct being encoded
// - in(encoder): encoder struct
GenInitEncoder() (string, error)
// codegen parsing context struct fields
GenParsingContextStruct() (string, error)
// codegen parsing context initialization
GenInitContext() (string, error)
// codegen reading from buffer
// - in(value): struct being decoded
// - in(context): parsing context (if with context)
// - in(reader): byte reader
// - in(ignoreCritical): ignore critical flag
GenReadFrom() (string, error)
// codegen skipping reading a field
// - in(value): struct being decoded
// - out(err): error variable
GenSkipProcess() (string, error)
// codegen converting to dict
GenToDict() (string, error)
// codegen converting from dict
GenFromDict() (string, error)
}

Expand Down

0 comments on commit e287432

Please sign in to comment.