-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(encoder): no more useless types
- Loading branch information
Showing
1 changed file
with
0 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,5 @@ | ||
package encoder | ||
|
||
import "reflect" | ||
|
||
// FieldConfig defines the structure of a single field in the payload | ||
type FieldConfig struct { | ||
Name string | ||
Start int | ||
Length int | ||
Transform func(interface{}) interface{} | ||
Optional bool | ||
Hex bool | ||
} | ||
|
||
// PayloadConfig defines the overall structure of the payload, including the target struct type | ||
type PayloadConfig struct { | ||
Fields []FieldConfig | ||
TargetType reflect.Type | ||
StatusByteIndex *int // can be nil | ||
} | ||
|
||
type Encoder interface { | ||
Encode(interface{}, int16, string) (interface{}, interface{}, error) | ||
} |