From 4f77442eff59061ac5ab9f710fdb6fe998fedb5f Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sun, 24 Sep 2023 01:23:50 +0200 Subject: Add identity resource --- external/evcli/identities.go | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'external/evcli/identities.go') diff --git a/external/evcli/identities.go b/external/evcli/identities.go index f89ae1b..a2c2549 100644 --- a/external/evcli/identities.go +++ b/external/evcli/identities.go @@ -2,7 +2,6 @@ package evcli import ( "encoding/json" - "fmt" "time" "github.com/exograd/eventline/pkg/eventline" @@ -27,7 +26,6 @@ type Identity struct { RefreshTime *time.Time `json:"refresh_time,omitempty"` Connector string `json:"connector"` Type string `json:"type"` - Data eventline.IdentityData `json:"-"` RawData json.RawMessage `json:"data"` } @@ -45,29 +43,3 @@ func (i *Identity) SortKey(sort string) (key string) { return } - -func (pi *Identity) MarshalJSON() ([]byte, error) { - type Identity2 Identity - - i := Identity2(*pi) - data, err := json.Marshal(i.Data) - if err != nil { - return nil, fmt.Errorf("cannot encode data: %w", err) - } - - i.RawData = data - - return json.Marshal(i) -} - -func (pi *Identity) UnmarshalJSON(data []byte) error { - type Identity2 Identity - - i := Identity2(*pi) - if err := json.Unmarshal(data, &i); err != nil { - return err - } - - *pi = Identity(i) - return nil -} -- cgit v1.2.3