client

package
v0.0.0-...-5bdf5b5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2020 License: MIT Imports: 14 Imported by: 0

README

Transactions

The sequence diagram for each authentication's transaction has been done via Draw.io provided by Google.

In the following table are provided each public link for the corresponding transaction's design.

Name Diagrams Description
TxLogin Drive (TODO) Creates a new session or update the latest one for a given client, if exists.
TxGoogleLogin Drive (TODO) Creates a new session or signs up a new user-client in base on google's provided information
TxLogout Drive (TODO) Kills the provided session and all them related to the same client
TxSignupUser Drive (TODO) Creates a brand new user and opens its first session for a given application
TxRegisterApp Drive (TODO) Registers a brand new application into the system

To understand the relationship between objects take a look at the conceptual diagram.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTxGoogleSignin

func NewTxGoogleSignin(req *pb.GoogleSigninRequest) transaction.Tx

NewTxGoogleSignin builds a brand new instance of TxGoogleLogin

func NewTxLogin

func NewTxLogin(req *pb.LoginRequest) transaction.Tx

NewTxLogin builds a brand new instance of TxLogin

func NewTxLogout

func NewTxLogout(req *pb.LogoutRequest) transaction.Tx

NewTxLogout builds a brand new instance of TxLogout

func NewTxSignup

func NewTxSignup(req *pb.SignupRequest) transaction.Tx

NewTxSignup builds a brand new instance of TxSignup

func SetupDummyUser

func SetupDummyUser() (err error)

SetupDummyUser inits a dummy user for testing

Types

type TxGoogleSignin

type TxGoogleSignin struct {
	// contains filtered or unexported fields
}

TxGoogleSignin represents an

func (*TxGoogleSignin) Commit

func (tx *TxGoogleSignin) Commit() (err error)

Commit commits the session and make its alive.

func (*TxGoogleSignin) Postcondition

func (tx *TxGoogleSignin) Postcondition(ctx context.Context) (resp interface{}, err error)

Postcondition creates a new session or update the latest one for a provided user, if exists.

func (*TxGoogleSignin) Precondition

func (tx *TxGoogleSignin) Precondition() (err error)

Precondition validates the transaction is ready to run. That means it does validates all parameters and connection requirements to make sure the transaction has chances of commit.

func (*TxGoogleSignin) Rollback

func (tx *TxGoogleSignin) Rollback()

Rollback the session in order to make it non existence

type TxLogin

type TxLogin struct {
	// contains filtered or unexported fields
}

TxLogin represents an

func (*TxLogin) Commit

func (tx *TxLogin) Commit() error

Commit commits the session and make its alive.

func (*TxLogin) Postcondition

func (tx *TxLogin) Postcondition(context.Context) (interface{}, error)

Postcondition creates a new session or update the latest one for a provided user, if exists.

func (*TxLogin) Precondition

func (tx *TxLogin) Precondition() error

Precondition validates the transaction is ready to run. That means it does validates all parameters and connection requirements to make sure the transaction has chances of commit.

func (*TxLogin) Rollback

func (tx *TxLogin) Rollback()

Rollback the session in order to make it non existence

type TxLogout

type TxLogout struct {
	// contains filtered or unexported fields
}

TxLogout represents an

func (*TxLogout) Commit

func (tx *TxLogout) Commit() error

Commit commits the logout and makes @sure_of_done

func (*TxLogout) Postcondition

func (tx *TxLogout) Postcondition(context.Context) (interface{}, error)

Postcondition kills the provided session and all them related to the same user

func (*TxLogout) Precondition

func (tx *TxLogout) Precondition() error

Precondition validates the transaction is ready to run. That means making sure the session exists.

func (*TxLogout) Rollback

func (tx *TxLogout) Rollback()

Rollback rollbacks the logout keeping all sessions in the latest state

type TxSignup

type TxSignup struct {
	// contains filtered or unexported fields
}

TxSignup represents an

func (*TxSignup) Commit

func (tx *TxSignup) Commit() error

Commit commits the transaction result

func (*TxSignup) Postcondition

func (tx *TxSignup) Postcondition(context.Context) (interface{}, error)

Postcondition creates new user and a opens its first session

func (*TxSignup) Precondition

func (tx *TxSignup) Precondition() error

Precondition validates the transaction is ready to run

func (*TxSignup) Rollback

func (tx *TxSignup) Rollback()

Rollback rollbacks any change caused while the transaction

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL