Go SDK: Align hooks with SEP (#23)
The SEP spec and C# SDK use hooks (plural, JSON array) but the Go SDK
had hook (singular, single object). This meant the wire formats were
incompatible — Go would send `{"hook": {...}}` while everything else
expects `{"hooks": [...]}`.
Signed-off-by: Ukjae Jeong <jeongukjae@gmail.com>
This commit is contained in:
parent
2b1d10093e
commit
23d889254b
1 changed files with 110 additions and 92 deletions
|
|
@ -42,7 +42,7 @@ type InterceptorInfo struct {
|
|||
Version string `json:"version,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Type InterceptorType `json:"type"`
|
||||
Hook Hook `json:"hook"`
|
||||
Hooks []Hook `json:"hooks"`
|
||||
PriorityHint Priority `json:"priorityHint,omitempty"`
|
||||
Compat *Compat `json:"compat,omitempty"`
|
||||
ConfigSchema json.RawMessage `json:"configSchema,omitempty"`
|
||||
|
|
@ -58,7 +58,7 @@ func InfoFromInterceptor(i Interceptor) InterceptorInfo {
|
|||
Version: m.Version,
|
||||
Description: m.Description,
|
||||
Type: i.GetType(),
|
||||
Hook: m.Hook,
|
||||
Hooks: m.Hooks,
|
||||
PriorityHint: m.PriorityHint,
|
||||
Compat: m.Compat,
|
||||
ConfigSchema: m.ConfigSchema,
|
||||
|
|
|
|||
Loading…
Reference in a new issue