Documentation ¶
Index ¶
- type CloudFoundry
- type DatabaseService
- func (service *DatabaseService) Array(model interface{}, expr string, retval interface{}, condition string, ...)
- func (service *DatabaseService) ColumnsWhere(model interface{}, columns []string, condition string, params ...interface{}) error
- func (service *DatabaseService) Count(model interface{}, condition string, params ...interface{}) int
- func (service *DatabaseService) CountExpr(model interface{}, expr string, retval interface{}, condition string, ...)
- func (service *DatabaseService) Delete(query interface{}) error
- func (service *DatabaseService) Find(query interface{}, callback func(query interface{}))
- func (service *DatabaseService) FindAll(model interface{}) error
- func (service *DatabaseService) Insert(query ...interface{}) error
- func (service *DatabaseService) Raw(query interface{}, params ...interface{}) error
- func (service *DatabaseService) Save(query ...interface{}) error
- func (service *DatabaseService) Select(query interface{}) error
- func (service *DatabaseService) Update(query interface{}) error
- func (service *DatabaseService) Where(model interface{}, condition string, params ...interface{}) error
- type Geocoder
- type LogService
- func (service *LogService) AddField(name string, value interface{})
- func (service *LogService) Debug(message string, fields api.LogFields)
- func (service *LogService) DebugError(message string, err error, fields api.LogFields)
- func (service *LogService) Fatal(message string, fields api.LogFields)
- func (service *LogService) FatalError(message string, err error, fields api.LogFields)
- func (service *LogService) Info(message string, fields api.LogFields)
- func (service *LogService) InfoError(message string, err error, fields api.LogFields)
- func (service *LogService) Panic(message string, fields api.LogFields)
- func (service *LogService) PanicError(message string, err error, fields api.LogFields)
- func (service *LogService) Print(message string, fields api.LogFields)
- func (service *LogService) PrintError(message string, err error, fields api.LogFields)
- func (service *LogService) Warn(message string, fields api.LogFields)
- func (service *LogService) WarnError(message string, err error, fields api.LogFields)
- type Native
- type SamlService
- type StorageService
- func (s *StorageService) CreateApplication(app api.Application) error
- func (s *StorageService) CreateAttachment(attachment *api.Attachment) error
- func (s *StorageService) CreateOrUpdateSession(accountID int, sessionKey string, expirationDate time.Time) error
- func (s *StorageService) DeleteApplication(accountID int) error
- func (s *StorageService) DeleteAttachment(accountID int, attachmentID int) error
- func (s *StorageService) DeleteSession(sessionKey string) error
- func (s *StorageService) FetchSessionAccount(sessionKey string) (api.Account, error)
- func (s *StorageService) ListAttachmentsMetadata(accountID int) ([]api.Attachment, error)
- func (s *StorageService) LoadApplication(accountID int) (api.Application, error)
- func (s *StorageService) LoadAttachment(accountID int, attachmentID int) (api.Attachment, error)
- func (s *StorageService) SaveSection(section api.Section, accountID int) error
- func (s *StorageService) UpdateApplication(app api.Application) error
- type TokenService
- func (service TokenService) CheckToken(request *http.Request) (string, int, error)
- func (service TokenService) ConfigureEnvironment(size int) error
- func (service TokenService) CurrentAudience(request *http.Request) string
- func (service TokenService) ExtractToken(request *http.Request) string
- func (service TokenService) NewToken(id int, audience string) (string, time.Time, error)
- func (service TokenService) Secret() []byte
- func (service TokenService) TargetAudiences() []string
- func (service TokenService) Timeout() time.Duration
- type XMLService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloudFoundry ¶
type CloudFoundry struct{}
CloudFoundry mock implementation.
func (CloudFoundry) Configure ¶
func (env CloudFoundry) Configure()
Configure the settings per the CloudFoundry environment.
type DatabaseService ¶
DatabaseService mock implementation.
func (*DatabaseService) Array ¶
func (service *DatabaseService) Array(model interface{}, expr string, retval interface{}, condition string, params ...interface{})
Array fills an array from the model and expression.
func (*DatabaseService) ColumnsWhere ¶
func (service *DatabaseService) ColumnsWhere(model interface{}, columns []string, condition string, params ...interface{}) error
ColumnsWhere is a Conditional selection based on the model in the data store only returning specific quoted columns.
func (*DatabaseService) Count ¶
func (service *DatabaseService) Count(model interface{}, condition string, params ...interface{}) int
Count return the number of rows found.
func (*DatabaseService) CountExpr ¶
func (service *DatabaseService) CountExpr(model interface{}, expr string, retval interface{}, condition string, params ...interface{})
CountExpr return the number of rows found with an expression.
func (*DatabaseService) Delete ¶
func (service *DatabaseService) Delete(query interface{}) error
Delete removes the model from the data store
func (*DatabaseService) Find ¶
func (service *DatabaseService) Find(query interface{}, callback func(query interface{}))
Find will check if the model exists and run the additional functionality.
func (*DatabaseService) FindAll ¶
func (service *DatabaseService) FindAll(model interface{}) error
FindAll instances of a type of model.
func (*DatabaseService) Insert ¶
func (service *DatabaseService) Insert(query ...interface{}) error
Insert persists the new model in the data store
func (*DatabaseService) Raw ¶
func (service *DatabaseService) Raw(query interface{}, params ...interface{}) error
Raw executes a string of SQL.
func (*DatabaseService) Save ¶
func (service *DatabaseService) Save(query ...interface{}) error
Save persists the model in the data store
func (*DatabaseService) Select ¶
func (service *DatabaseService) Select(query interface{}) error
Select returns the model from the data store
func (*DatabaseService) Update ¶
func (service *DatabaseService) Update(query interface{}) error
Update persists the existing model in the data store
func (*DatabaseService) Where ¶
func (service *DatabaseService) Where(model interface{}, condition string, params ...interface{}) error
Where is a conditional selection based on the model in the data store.
type Geocoder ¶
type Geocoder struct{}
Geocoder is a mock implementation.
func (Geocoder) Validate ¶
func (service Geocoder) Validate(api.GeocodeValues) (api.GeocodeResults, error)
Validate takes values to be geocoded and executes a web service call
type LogService ¶
type LogService struct { Off bool // contains filtered or unexported fields }
LogService mock implementation of logging.
func (*LogService) AddField ¶
func (service *LogService) AddField(name string, value interface{})
AddField will add a field using the name and value to the logger.
func (*LogService) Debug ¶
func (service *LogService) Debug(message string, fields api.LogFields)
Debug outputs a debug message to the log.
func (*LogService) DebugError ¶
func (service *LogService) DebugError(message string, err error, fields api.LogFields)
DebugError outputs a debug message and error to the log.
func (*LogService) Fatal ¶
func (service *LogService) Fatal(message string, fields api.LogFields)
Fatal outputs a fatal message to the log.
func (*LogService) FatalError ¶
func (service *LogService) FatalError(message string, err error, fields api.LogFields)
FatalError outputs a fatal message and error to the log.
func (*LogService) Info ¶
func (service *LogService) Info(message string, fields api.LogFields)
Info outputs a informative message to the log.
func (*LogService) InfoError ¶
func (service *LogService) InfoError(message string, err error, fields api.LogFields)
InfoError outputs a informative message and error to the log.
func (*LogService) Panic ¶
func (service *LogService) Panic(message string, fields api.LogFields)
Panic outputs a panic message to the log.
func (*LogService) PanicError ¶
func (service *LogService) PanicError(message string, err error, fields api.LogFields)
PanicError outputs a panic message and error to the log.
func (*LogService) Print ¶
func (service *LogService) Print(message string, fields api.LogFields)
Print outputs a message to the log.
func (*LogService) PrintError ¶
func (service *LogService) PrintError(message string, err error, fields api.LogFields)
PrintError outputs a message and error to the log.
type Native ¶
type Native struct{}
Native is a mock (not really) implementation.
type SamlService ¶
type SamlService struct{}
SamlService mock implementation of SAML handling.
func (*SamlService) CreateAuthenticationRequest ¶
func (service *SamlService) CreateAuthenticationRequest() (string, string, error)
CreateAuthenticationRequest creates a SAML 2.0 authentication request based on the service provider settings. If configured to sign the request then the Base64 XML will be signed.
func (*SamlService) ValidateAuthenticationResponse ¶
func (service *SamlService) ValidateAuthenticationResponse(encoded string) (string, error)
ValidateAuthenticationResponse validations a SAML authentication response.
type StorageService ¶
type StorageService struct{}
StorageService is a mock storage service
func (*StorageService) CreateApplication ¶
func (s *StorageService) CreateApplication(app api.Application) error
CreateApplication creates an application in the db. Errors if already exists.
func (*StorageService) CreateAttachment ¶
func (s *StorageService) CreateAttachment(attachment *api.Attachment) error
CreateAttachment creates an attachment in the database
func (*StorageService) CreateOrUpdateSession ¶
func (s *StorageService) CreateOrUpdateSession(accountID int, sessionKey string, expirationDate time.Time) error
CreateOrUpdateSession creates a new session record in the db
func (*StorageService) DeleteApplication ¶
func (s *StorageService) DeleteApplication(accountID int) error
DeleteApplication deletes an attachment for the given account
func (*StorageService) DeleteAttachment ¶
func (s *StorageService) DeleteAttachment(accountID int, attachmentID int) error
DeleteAttachment deletes an attachment for the given account
func (*StorageService) DeleteSession ¶
func (s *StorageService) DeleteSession(sessionKey string) error
DeleteSession removes a session record from the db
func (*StorageService) FetchSessionAccount ¶
func (s *StorageService) FetchSessionAccount(sessionKey string) (api.Account, error)
FetchSessionAccount fetches an account and session data from the db
func (*StorageService) ListAttachmentsMetadata ¶
func (s *StorageService) ListAttachmentsMetadata(accountID int) ([]api.Attachment, error)
ListAttachmentsMetadata returns a slice of attachments' metadata for a given account.
func (*StorageService) LoadApplication ¶
func (s *StorageService) LoadApplication(accountID int) (api.Application, error)
LoadApplication returns the given application from the db.
func (*StorageService) LoadAttachment ¶
func (s *StorageService) LoadAttachment(accountID int, attachmentID int) (api.Attachment, error)
LoadAttachment loads an attachment from the database
func (*StorageService) SaveSection ¶
func (s *StorageService) SaveSection(section api.Section, accountID int) error
SaveSection replaces a single section in the given application with the passed in section
func (*StorageService) UpdateApplication ¶
func (s *StorageService) UpdateApplication(app api.Application) error
UpdateApplication replaces an existing application with the passed in one.
type TokenService ¶
type TokenService struct{}
TokenService is a mock implementation of JWT service handling.
func (TokenService) CheckToken ¶
CheckToken tests if the token is valid and is of the correct audience.
func (TokenService) ConfigureEnvironment ¶
func (service TokenService) ConfigureEnvironment(size int) error
ConfigureEnvironment ensure the secret is set prior to use.
func (TokenService) CurrentAudience ¶
func (service TokenService) CurrentAudience(request *http.Request) string
CurrentAudience is the currently valid audience from the token.
func (TokenService) ExtractToken ¶
func (service TokenService) ExtractToken(request *http.Request) string
ExtractToken returns the token from an HTTP request header.
func (TokenService) NewToken ¶
NewToken generates a new Jwt signed token using a users account information
func (TokenService) Secret ¶
func (service TokenService) Secret() []byte
Secret returns the secret to use with JWT tokens.
func (TokenService) TargetAudiences ¶
func (service TokenService) TargetAudiences() []string
TargetAudiences which are accepted based on the configured environment.
func (TokenService) Timeout ¶
func (service TokenService) Timeout() time.Duration
Timeout returns the duration in time for how long a session is considered valid. Per policy this defaults to 15 minutes.
type XMLService ¶
type XMLService struct{}
XMLService is a mock implementation of handling XML.
func (*XMLService) PackageXML ¶
func (service *XMLService) PackageXML(app api.Application) (template.HTML, error)
PackageXML returns a template given data.