Mercurial > gemma
comparison misc/encode.go @ 386:999f4f83a072
Configure GeoServer via REST-API. TODO: Configure layers.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 13 Aug 2018 13:41:08 +0200 |
parents | 4c211ad5349e |
children |
comparison
equal
deleted
inserted
replaced
385:3cfab707f909 | 386:999f4f83a072 |
---|---|
1 package misc | 1 package misc |
2 | 2 |
3 import ( | 3 import ( |
4 "encoding/base64" | |
4 "encoding/binary" | 5 "encoding/binary" |
5 "io" | 6 "io" |
6 ) | 7 ) |
7 | 8 |
8 type BinReader struct { | 9 type BinReader struct { |
66 } | 67 } |
67 if w.Err == nil { | 68 if w.Err == nil { |
68 w.Err = binary.Write(w.Writer, binary.BigEndian, []byte(s)) | 69 w.Err = binary.Write(w.Writer, binary.BigEndian, []byte(s)) |
69 } | 70 } |
70 } | 71 } |
72 | |
73 func BasicAuth(user, password string) string { | |
74 auth := user + ":" + password | |
75 return base64.StdEncoding.EncodeToString([]byte(auth)) | |
76 } |