From dbc27c3a29e6644688d015f36c689165e6d90168 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sun, 13 Dec 2015 01:29:26 +0100 Subject: More strong typing --- messages.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'messages.go') diff --git a/messages.go b/messages.go index 7527aa3..c4bf8e5 100644 --- a/messages.go +++ b/messages.go @@ -24,18 +24,18 @@ type Directory struct { // Registration Objects type Registration struct { - Resource Resource `json:"resource"` // new-reg - Contact []Contact `json:"contact,omitempty"` - Agreement string `json:"agreement,omitempty"` - Authorizations string `json:"authorizations,omitempty"` - Certificates string `json:"certificates,omitempty"` + Resource Resource `json:"resource"` // new-reg + Contact Contacts `json:"contact,omitempty"` + Agreement string `json:"agreement,omitempty"` + Authorizations string `json:"authorizations,omitempty"` + Certificates string `json:"certificates,omitempty"` } // RegistrationResp ... type RegistrationResp struct { ID int `json:"id"` Key Key `json:"key"` - Contact []string `json:"contact"` + Contact Contacts `json:"contact"` InitialIP net.IP `json:"initialIp"` // not in draft CreatedAt time.Time `json:"createdAt"` // 2006-01-02T15:04:05.999999999Z } @@ -57,7 +57,7 @@ type Authorization struct { type AuthorizationResp struct { Identifier Identifier `json:"identifier"` Status Status `json:"status,omitemtpy"` // e.g. valid - Expires string `json:"expires,omitempty"` // 2006-01-02 + Expires time.Time `json:"expires,omitempty"` // 2006-01-02 Challenges []Challenge `json:"challenges"` Combinations [][]int `json:"combinations,omitemtpy"` } @@ -72,7 +72,7 @@ type Identifier struct { type Challenge struct { Type ChallengeType `json:"type"` // http-01 Status Status `json:"status"` // e.g. valid - Validated string `json:"validated"` // 2006-01-02T15:04Z + Validated time.Time `json:"validated"` // 2006-01-02T15:04Z KeyAuthorization string `json:"keyAuthorization"` } -- cgit v1.2.3