Commit 0c6d5606 authored by Sietse Ringers's avatar Sietse Ringers
Browse files

Rename server backend package to core


Co-authored-by: Tomas's avatarConfiks <confiks@scriptbase.org>
parent a39a86ef
package backend
package core
import (
"encoding/json"
......
package backend
package core
import (
"github.com/privacybydesign/gabi"
......
package backend
package core
import (
"os"
......
package backend
package core
import (
"math/rand"
......
......@@ -6,7 +6,7 @@ import (
"github.com/privacybydesign/irmago"
"github.com/privacybydesign/irmago/server"
"github.com/privacybydesign/irmago/server/backend"
"github.com/privacybydesign/irmago/server/core"
)
// SessionHandler is a function that can handle a session result
......@@ -17,14 +17,14 @@ var handlers = make(map[string]SessionHandler)
// Initialize sets configuration.
func Initialize(configuration *server.Configuration) error {
return backend.Initialize(configuration)
return core.Initialize(configuration)
}
// StartSession starts an IRMA session, running the handler on completion, if specified.
// The session token (the second return parameter) can be used in GetSessionResult()
// and CancelSession().
func StartSession(request irma.SessionRequest, handler SessionHandler) (*irma.Qr, string, error) {
qr, token, err := backend.StartSession(request)
qr, token, err := core.StartSession(request)
if err != nil {
return nil, "", err
}
......@@ -36,12 +36,12 @@ func StartSession(request irma.SessionRequest, handler SessionHandler) (*irma.Qr
// GetSessionResult retrieves the result of the specified IRMA session.
func GetSessionResult(token string) *server.SessionResult {
return backend.GetSessionResult(token)
return core.GetSessionResult(token)
}
// CancelSession cancels the specified IRMA session.
func CancelSession(token string) error {
return backend.CancelSession(token)
return core.CancelSession(token)
}
// HttpHandlerFunc returns a http.HandlerFunc that handles the IRMA protocol
......@@ -59,7 +59,7 @@ func HttpHandlerFunc() http.HandlerFunc {
w.WriteHeader(http.StatusInternalServerError)
return
}
status, response, result := backend.HandleProtocolMessage(r.URL.Path, r.Method, r.Header, message)
status, response, result := core.HandleProtocolMessage(r.URL.Path, r.Method, r.Header, message)
w.WriteHeader(status)
w.Write(response)
if result != nil {
......
......@@ -13,7 +13,7 @@ import (
"github.com/Sirupsen/logrus"
"github.com/go-errors/errors"
"github.com/privacybydesign/irmago/server"
"github.com/privacybydesign/irmago/server/backend"
"github.com/privacybydesign/irmago/server/core"
"github.com/privacybydesign/irmago/server/irmaserver"
"github.com/spf13/cobra"
"github.com/spf13/viper"
......@@ -60,7 +60,7 @@ func setFlags(cmd *cobra.Command) error {
flags := cmd.Flags()
flags.SortFlags = false
cachepath, err := backend.CachePath()
cachepath, err := core.CachePath()
if err != nil {
return err
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment