Documentation ¶
Index ¶
- Constants
- type ServiceCreator
- type ServiceProcess
- func (s *ServiceProcess) PackageCodeMsg(code int, msg string) (record.Packer, error)
- func (s *ServiceProcess) PackageErr(err error) (record.Packer, error)
- func (s *ServiceProcess) PackageOk() (record.Packer, error)
- func (s *ServiceProcess) Reset() *ServiceProcess
- func (s *ServiceProcess) SetupService(c *configure.Configure, requestPackage string) (record.Packer, error)
- func (s *ServiceProcess) Teardown() error
- type ServiceProcessor
Constants ¶
const ( SERVICE_EMPTY_BODY = "" PERMIT_ALL = "permit_all" PERMIT_LOGIN = "permit_login" PERMIT_PASSWORD = "permit_password" PERMIT_NAME = "permit_name" PERMIT_EMAIL = "permit_email" )
Permissions for updating
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServiceCreator ¶
type ServiceCreator func() *ServiceProcess
Service creator is any function that returns a pointer to a ServiceProcess.
type ServiceProcess ¶
type ServiceProcess struct { // Points to the function that will process the request. It will be passed this structure. Run func(*ServiceProcess) (record.Packer, error) // Point to the configuration class. All configuration is held here. Config *configure.Configure // The request head is the unpacked header that was decoded from the incoming // request package. RequestHead *head.Head // The request body, unpacked for the service record RequestBody record.BodyInterface // Client record making the request. This can come from the user or client database Client *tenant.User // Header for response we are sending back. ResponseHead *head.Head // Record package - this is what will be returned from any of the calls. ResponsePackage record.Packer // Datastore for user records. The clientstore, if separate, is not stored as it is // only needed once to access the client record. UserStore storage.Storer // Options can be used to set any options that are desired for the routines. Options map[string]string SetFlag bool }
All of the service control requirements are stored in this structure. This points to the runtime function that will receive this information.
func NewServiceAuthenticate ¶
func NewServiceAuthenticate() *ServiceProcess
The Structure that gives us the entry point for user record updates
func NewServiceLogin ¶
func NewServiceLogin() *ServiceProcess
The Structure that gives us the entry point for user Login
func NewServiceLogout ¶
func NewServiceLogout() *ServiceProcess
The Structure that gives us the entry point for user Logout
func NewServiceRegister ¶
func NewServiceRegister() *ServiceProcess
func NewServiceTest ¶
func NewServiceTest() *ServiceProcess
NewServiceTest is the entry point for a client checking a connection
func NewServiceUpdate ¶
func NewServiceUpdate() *ServiceProcess
The Structure that gives us the entry point for user record updates
func (*ServiceProcess) PackageCodeMsg ¶
PackageCodeMsg will create a general error for GUS from an integer code and string passed.
func (*ServiceProcess) PackageErr ¶
func (s *ServiceProcess) PackageErr(err error) (record.Packer, error)
PackageErr will encode the error as a general error, set the error type in the header as 'Error' serialise it in JSON format and package up the response.
func (*ServiceProcess) PackageOk ¶
func (s *ServiceProcess) PackageOk() (record.Packer, error)
Return an OK package value. The package is signed, but no data is serialised.
func (*ServiceProcess) Reset ¶
func (s *ServiceProcess) Reset() *ServiceProcess
Allocate storage for all of the data in the structure. This will "reset" the storage and let the service be re-used.
func (*ServiceProcess) SetupService ¶
func (s *ServiceProcess) SetupService(c *configure.Configure, requestPackage string) (record.Packer, error)
Setup the service structure for common values required. This will take the request package and unpack it into the header and service-specific body.
func (*ServiceProcess) Teardown ¶
func (s *ServiceProcess) Teardown() error
Perform any cleanup needed, closing any connections.