Documentation ¶
Index ¶
- func FromJson(jsonString string, typeItem reflect.Type) (interface{}, error)
- func GetConfigurationFromSources(sources []source.Source) (config.Config, error)
- func ToJson(obj interface{}) (result []byte, err error)
- func Write200Json(w http.ResponseWriter, content string)
- func Write404Json(w http.ResponseWriter)
- func Write500Json(w http.ResponseWriter, message string)
- type Action
- type Application
- type Configuration
- type DefaultLogger
- type EmailAddress
- type Extension
- type Group
- type GroupMembership
- type GroupPrivilege
- type GroupRole
- type HeaderConfiguration
- type Logger
- type MailSendResponse
- type MailSender
- type NoOpExtension
- type SilentLogger
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromJson ¶ added in v0.3.9
typeOfPtr should be the type of a pointer to the type you're unmarshalling to
func Write200Json ¶ added in v0.3.4
func Write200Json(w http.ResponseWriter, content string)
func Write404Json ¶
func Write404Json(w http.ResponseWriter)
func Write500Json ¶
func Write500Json(w http.ResponseWriter, message string)
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
func (*Application) GetConfiguration ¶
func (ac *Application) GetConfiguration() *Configuration
func (*Application) GetLogger ¶
func (ac *Application) GetLogger() Logger
func (*Application) GetRouter ¶
func (ac *Application) GetRouter() *mux.Router
func (*Application) Init ¶
func (ac *Application) Init(config *Configuration, logger Logger, extensions []Extension) error
func (*Application) Run ¶
func (ac *Application) Run() error
type Configuration ¶
type Configuration struct { HeaderConfiguration HeaderConfiguration Port int Raw config.Config StaticDirectory string }
func LoadConfiguration ¶ added in v0.2.0
func LoadConfiguration(sources *[]source.Source) (*Configuration, error)
"merging priority is in reverse order" if nil, environment source used
type DefaultLogger ¶
type DefaultLogger struct{}
func (DefaultLogger) Debug ¶
func (logger DefaultLogger) Debug(message string)
func (DefaultLogger) Error ¶
func (logger DefaultLogger) Error(message string)
func (DefaultLogger) Info ¶
func (logger DefaultLogger) Info(message string)
func (DefaultLogger) Warn ¶
func (logger DefaultLogger) Warn(message string)
type EmailAddress ¶ added in v0.8.0
type Extension ¶
type Extension interface { Init(app *Application) error AddRoutes(app *Application) error Destroy(app *Application) error }
type GroupMembership ¶ added in v0.10.0
type GroupMembership struct { ID string `json:"id" bson:"_id" gorm:"primary_key"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt *time.Time `json:"deletedAt,omitempty" sql:"index"` GroupID string `json:"groupId"` MemberID string `json:"memberId"` Role GroupRole `json:"role"` }
type GroupPrivilege ¶ added in v0.10.0
type GroupPrivilege struct { ID string `json:"id" bson:"_id" gorm:"primary_key"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt *time.Time `json:"deletedAt,omitempty" sql:"index"` PerformingGroupID string `json:"performingGroupID"` // e.g. "administrators" ID TargetGroupID string `json:"targetGroupID"` // e.g. "customers" ID Action int `json:"action"` // e.g. read/write/admin/etc }
type HeaderConfiguration ¶
type MailSendResponse ¶ added in v0.8.0
type MailSender ¶ added in v0.8.0
type MailSender interface {
SendMail(from *EmailAddress, subject string, to []*EmailAddress, plainTextContent string, htmlContent string) (*MailSendResponse, error)
}
type NoOpExtension ¶
type NoOpExtension struct { }
func (*NoOpExtension) AddRoutes ¶
func (s *NoOpExtension) AddRoutes(app *Application) error
func (*NoOpExtension) Destroy ¶
func (s *NoOpExtension) Destroy(app *Application) error
func (*NoOpExtension) Init ¶
func (s *NoOpExtension) Init(app *Application) error
type SilentLogger ¶
type SilentLogger struct{}
func (SilentLogger) Debug ¶
func (logger SilentLogger) Debug(message string)
func (SilentLogger) Error ¶
func (logger SilentLogger) Error(message string)
func (SilentLogger) Info ¶
func (logger SilentLogger) Info(message string)
func (SilentLogger) Warn ¶
func (logger SilentLogger) Warn(message string)
type User ¶ added in v0.10.0
type User struct { ID string `json:"id" bson:"_id" gorm:"primary_key"` // ID CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt *time.Time `json:"deletedAt,omitempty" sql:"index"` Email *string `json:"email,omitempty" gorm:"unique"` Username *string `json:"username,omitempty" gorm:"unique"` FirstName *string `json:"firstName,omitempty"` LastName *string `json:"lastName,omitempty"` Title *string `json:"title,omitempty"` Password *string `json:"password,omitempty"` PortraitUri *string `json:"portraitUri,omitempty"` AvatarUri *string `json:"avatarUri,omitempty"` StatusText *string `json:"statusText,omitempty"` IsActive *bool `json:"isActive,omitempty"` IsEmailValidated *bool `json:"isEmailValidated,omitempty"` DeactivatedAt *time.Time `json:"deactivatedAt,omitempty"` LastLogin *time.Time `json:"lastLogin,omitempty"` FailedLoginCount *int8 `json:"failedLoginCount,omitempty"` Gender *string `json:"gender,omitempty" gorm:"size:1"` PhoneHome *string `json:"phoneHome,omitempty" gorm:"size:24"` PhoneWork *string `json:"phoneWork,omitempty" gorm:"size:24"` PhoneMobile *string `json:"phoneMobile,omitempty" gorm:"size:24"` PhoneOther *string `json:"phoneOther,omitempty" gorm:"size:24"` Fax *string `json:"fax,omitempty" gorm:"size:24"` Uri *string `json:"uri,omitempty"` Birthday *string `json:"birthday,omitempty"` Bio *string `json:"bio,omitempty"` AddressLine1 *string `json:"addressLine1,omitempty"` AddressLine2 *string `json:"addressLine2,omitempty"` AddressLine3 *string `json:"addressLine3,omitempty"` AddressCity *string `json:"addressCity,omitempty"` AddressStateOrProvince *string `json:"addressStateOrProvince,omitempty"` AddressPostalCode *string `gorm:"size:16" json:"postalCode,omitempty"` CountryCode *string `gorm:"size:3" json:"countryCode,omitempty"` EmployeeId *string `json:"employeeId,omitempty"` ReferenceId *string `json:"referenceId,omitempty"` PasswordResetToken *string `json:"passwordResetToken,omitempty"` PasswordResetExpiration *time.Time `json:"passwordResetExpiration,omitempty"` EmailValidationToken *string `json:"emailValidationToken,omitempty"` EmailValidationExpiration *time.Time `json:"emailValidationExpiration,omitempty"` EmploymentStartDate *time.Time `json:"employmentStartDate,omitempty"` EmploymentEndDate *time.Time `json:"employmentEndDate,omitempty"` ContractStartDate *time.Time `json:"contractStartDate,omitempty"` ContractEndDate *time.Time `json:"contractEndDate,omitempty"` PrimaryLocation *string `json:"primaryLocation,omitempty"` // e.g. lat/long, grid codes, etc Context *string `json:"context,omitempty"` ProtectedContext *string `json:"protectedContext,omitempty"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.