From 016a0a8c3ec0666cf46d39abed1bcac0936aa846 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 5 Dec 2015 17:59:31 +0100 Subject: Put message structures and types together --- client.go | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'client.go') diff --git a/client.go b/client.go index ae3d81e..bf55f17 100644 --- a/client.go +++ b/client.go @@ -3,40 +3,12 @@ package acme import ( "bytes" "encoding/json" - "fmt" "log" "net/http" "net/textproto" "regexp" ) -type Status int - -const ( - StatusUnknown Status = iota - StatusPending - StatusProcessing - StatusValid - StatusInvalid - StatusRevoked -) - -func (s *Status) UnmarshalJSON(b []byte) error { - var status = map[string]Status{ - "unknown": StatusUnknown, - "pending": StatusPending, - "processing": StatusProcessing, - "valid": StatusValid, - "invalid": StatusInvalid, - "revoked": StatusRevoked, - } - if st, ok := status[string(b)]; ok { - *s = st - return nil - } - return fmt.Errorf("unknown status %v", string(b)) -} - type NonceSigner interface { Sign([]byte) ([]byte, error) parseNonce(*http.Response) -- cgit v1.2.3