Documentation
¶
Index ¶
- func MakeBotStorageProxyHandler(p *BotStorageReverseProxy) func(w http.ResponseWriter, r *http.Request)
- func MakeConiksProxyHandler(conf *config.Config) func(w http.ResponseWriter, r *http.Request)
- func MakePublicKeyGETAllHandler(db *badger.DB) func(w http.ResponseWriter, r *http.Request)
- func MakePublicKeyGETHandler(db *badger.DB) func(w http.ResponseWriter, r *http.Request)
- func MakePublicKeyPOSTHandler(db *badger.DB) func(w http.ResponseWriter, r *http.Request)
- func MakePublicKeyPUTHandler(db *badger.DB) func(w http.ResponseWriter, r *http.Request)
- type BotStorageReverseProxy
- type PublicKey
- type UserAllPK
- type UserPublicKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeBotStorageProxyHandler ¶
func MakeBotStorageProxyHandler(p *BotStorageReverseProxy) func(w http.ResponseWriter, r *http.Request)
MakeBotStorageProxyHandler is the handler for the route that proxies a request to the botstorage
func MakeConiksProxyHandler ¶
MakeConiksProxyHandler is the handler for the route that proxies a Coniks request
func MakePublicKeyGETAllHandler ¶
MakePublicKeyGETAllHandler is the handler for the API to get all the public keys of an user
func MakePublicKeyGETHandler ¶
MakePublicKeyGETHandler is the handler for the API to get a public key from a specific user and deviceID
func MakePublicKeyPOSTHandler ¶
MakePublicKeyPOSTHandler is the handler for the API to save a public key This public key is associated to an username and a deviceID
func MakePublicKeyPUTHandler ¶
MakePublicKeyPUTHandler is the handler for the API to update a public key from an username deviceID
Types ¶
type BotStorageReverseProxy ¶
type BotStorageReverseProxy struct { LocationPrefix string // The listening location path // contains filtered or unexported fields }
BotStorageReverseProxy is a structure that contains the needed information for the proxy
func New ¶
func New(listeningPath string, target string) *BotStorageReverseProxy
New creates a BotStorageReverseProxy given the ListeningPath and the target
func (*BotStorageReverseProxy) Handle ¶
func (p *BotStorageReverseProxy) Handle(w http.ResponseWriter, r *http.Request) error
Handle checks the JWT and proxies the request to the botstorage
type PublicKey ¶
type PublicKey struct {
PK string `json:"pk"`
}
PublicKey represents a public key in a JSON object
type UserAllPK ¶
UserAllPK is the structure that contains all the public Keys of an user (one PK per device)
type UserPublicKey ¶
type UserPublicKey struct { Login string `json:"login"` Device string `json:"deviceID"` PK string `json:"pk"` }
UserPublicKey is the structure that contains the public key associate to an user and a device