From c6261c5ce9537296479b621e91a90e4f57a21734 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 28 Nov 2015 18:52:49 +0100 Subject: WIP error handler --- messages.go | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) (limited to 'messages.go') diff --git a/messages.go b/messages.go index 07c6fe7..511c713 100644 --- a/messages.go +++ b/messages.go @@ -1,7 +1,5 @@ package acme -import jose "github.com/square/go-jose" - const ( // LEV1 Let's Encrytpt V1 LEV1 = `https://acme-v01.api.letsencrypt.org/directory` @@ -20,12 +18,27 @@ type Directory struct { // Registration Objects type Registration struct { - Resource string `json:"resource"` - Key jose.JsonWebKey `json:"key"` - Contact []string `json:"contact,omitempty"` - Agreement string `json:"agreement,omitempty"` - Authorizations string `json:"authorizations,omitempty"` - Certificates string `json:"certificates,omitempty"` + Resource string `json:"resource"` + Contact []string `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"` + InitialIP string `json:"initalIp"` + CreatedAt string `json:"createdAt"` // 2006-01-02T15:04:05.999999999Z +} + +// Key ... +type Key struct { + Kty string `json:"kty"` // RSA, EC + E string `json:"e"` + N string `json:"n"` } // Authorization Objects @@ -51,3 +64,10 @@ type Challege struct { Validated string `json:"validated"` // 2006-01-02T15:04Z KeyAuthorization string `json:"keyAuthorization"` } + +// Problem description +type Problem struct { + Type string `json:"type"` + Detail string `json:"detail"` + Instance string `json:"instance"` +} -- cgit v1.2.3