Documentation
¶
Overview ¶
package CommonWealth are all of the assets that various microservices might need to share
package CommonWealth are all of the assets that various microservices might need to share
package CommonWealth are all of the assets that various microservices might need to share
package CommonWealth are all of the assets that various microservices might need to share
package CommonWealth are all of the assets that various microservices might need to share
package CommonWealth are all of the assets that various microservices might need to share
package CommonWealth are all of the assets that various microservices might need to share
Index ¶
- Constants
- func CreateSubject(pieces []string) string
- func DetermineDeviceClientID() string
- func GenerateHashword(password string) (string, error)
- func StripBrackets(value string) string
- type DatabaseQuery
- type DatabaseResponse
- type LoginUser
- type NatsRegistration
- type NatsTopics
- type Session
- type SessionEntry
- type StatusData
- type User
- type UserEntry
- type WebResponse
Constants ¶
const ( Read = "read" Create = "create" Update = "update" Delete = "delete" AFM = "afm" Status = "status" Database = "database" Query = "query" SessionDatabase = "session" CompanyIndex = 0 ApplicationIndex = 1 CommandIndex = 2 )
Standard verbs subject/topics
const ( LoginSubject = "login" LogoutSubject = "logout" UserNameParameter = "user_name" )
const ( UserSubject = "user" AdminRole = "ADMIN" ModeratorRole = "MODERATOR" UserRole = "USER" BannedRole = "BANNED" )
UserSubject so we end up with user/create user/read, etc.
const (
SessionTableName = "session"
)
Variables ¶
This section is empty.
Functions ¶
func CreateSubject ¶
CreateSubject create a subject from a number of pieces
func DetermineDeviceClientID ¶
func DetermineDeviceClientID() string
func GenerateHashword ¶
GenerateHashword takes a password and returns an encoded string w/ random salt
func StripBrackets ¶
StripBrackets removes the starting and ending brackets if any
Types ¶
type DatabaseQuery ¶
type DatabaseResponse ¶
type NatsRegistration ¶
type NatsRegistration struct {
// contains filtered or unexported fields
}
func (*NatsRegistration) ConfigureNATsSystem ¶
func (reg *NatsRegistration) ConfigureNATsSystem() (*nats.Conn, error)
ConfigureNATsSystem creates a nats connection and registers callbacks
func (*NatsRegistration) Subscribe ¶
func (reg *NatsRegistration) Subscribe(nc *nats.Conn, topic NatsTopics, callback nats.MsgHandler) error
Subscribe allows users to subscribe to nats topics
type NatsTopics ¶
type NatsTopics struct {
Name string `yaml:"name"` // the name of the topic to subscribe to (subject)
Create bool `yaml:"create"` // the create verb if needed or not ignored if always
Read bool `yaml:"read"` // the read verb if needed or not ignored if always
Update bool `yaml:"update"` // the update verb if needed or not ignored if always
Delete bool `yaml:"delete"` // the delete verb if needed or not ignored if always
Always bool `yaml:"always"` // the always verb that subscribes to the given name only
}
NatsTopics are topics that will be handled by each service
type Session ¶
type Session struct {
SessionEntry SessionEntry `db:"session"`
}
type SessionEntry ¶
type StatusData ¶
type UserEntry ¶
type UserEntry struct {
ID uuid.UUID `db:"id"`
Role string `db:"role"`
FirstName string `db:"first_name"`
LastName string `db:"last_name"`
UserName string `db:"user_name"`
Email string `db:"email"`
Phone string `db:"phone"`
Password string `db:"password"`
PasswordChange *time.Time `db:"password_change"`
LastLogin *time.Time `db:"last_login"`
Created time.Time `db:"created"`
Updated time.Time `db:"updated"`
Active bool `db:"active"`
}
type WebResponse ¶
The response to the request