Add dummy methods for now

TODO: Store the required variables if not stored already
Preferably in a sqlite database.

Signed-off-by: Sayan Biswas <sayan@pokurt.me>
This commit is contained in:
Sayan Biswas 2021-10-07 19:36:07 +05:30
parent c9a4adf1d0
commit acb2d934da
No known key found for this signature in database
GPG Key ID: E1220C019C89B488
3 changed files with 14 additions and 6 deletions

View File

@ -2,4 +2,5 @@ package client
const (
RPC_ENDPOINT = "https://socialvoid.qlg1.com:5601/"
VERSION = "0.0.1"
)

View File

@ -1,7 +1,14 @@
package client
// GetSession
// Haven't thought of anything yet
func (s *SessionRegisterResponse) GetSession() {
return
func NewSession(publicHash string, privateHash string) (c *CreateSessionStruct) {
c.PrivateHash = privateHash
c.PublicHash = publicHash
c.Name = VERSION
c.Platform = ""
return c
}
func (c *CreateSessionStruct) GetChallengeAnswer(secret string) (string, error) {
// pvt_hash := c.PrivateHash
return "", nil
}

View File

@ -33,10 +33,10 @@ type SessionRegisterResponse struct {
LastName string `json:"last_name"`
}
// CreateSessionResponse Establishes a new session to the network, new and unauthenticated sessions expires after 10 minutes of inactivity,
// CreateSessionStruct Establishes a new session to the network, new and unauthenticated sessions expires after 10 minutes of inactivity,
// authenticating to the session will increase the expiration time to 72 hours of inactivity.
// This timer is reset whenever the session is used in one way or another.
type CreateSessionResponse struct {
type CreateSessionStruct struct {
// The Public Hash of the client that's establishing the session
PublicHash string `json:"public_hash"`
// The Private Hash of the client used when establishing the session