Documentation
¶
Index ¶
- func AssertResponse(t *testing.T, rr *httptest.ResponseRecorder, code int)
- func CallerInfo() string
- func ClusterAddShard(ctx ContextInterface, shardName string) error
- func ClusterAddShardMap(ctx ContextInterface, shardId string, domain string, accountId string) error
- func ClusterDeleteShard(ctx ContextInterface, shardName string) error
- func ClusterGetAccounts(ctx ContextInterface) (map[string][]Account, error)
- func ClusterGetShards(ctx ContextInterface) (map[string][]Shard, error)
- func ClusterUndeleteShard(ctx ContextInterface, shardName string) error
- func CreateAccount(ctx ContextInterface, shardName string, domain string) error
- func GetAppConfig() *config.Config
- func GetConfigEnvVar() string
- func GetConfigPath() string
- func GetDbCollection() *jgoWebDb.Collection
- func GetDefaultWebRouter() *web.Router
- func GetSessionManager() *scs.Manager
- func GetWebServer(router *web.Router, host string) *http.Server
- func GzipServeContent(w http.ResponseWriter, req *http.Request, name string, modTime time.Time, ...)
- func InitConfig()
- func InitDbCollection()
- func InitMetrics()
- func InitMockAccount()
- func InitMockCtx()
- func InitMockQueueJob()
- func InitMockShard()
- func InitMockShardMap()
- func InitMockSystemDbUpdate()
- func InitMockUser()
- func InitSession()
- func NewTestRequest(method, path string, body io.Reader) (*httptest.ResponseRecorder, *http.Request)
- func SetConfigEnvVar(envVar string)
- func SetConfigPath(path string)
- func Start(router *web.Router)
- func StartAll(router *web.Router)
- func StartHealthSink(hostname string)
- func StartHttpServer(router *web.Router, host string)
- func StartHttpsServer(router *web.Router)
- func StaticMiddleware(path string, option ...StaticOption) func(web.ResponseWriter, *web.Request, web.NextMiddlewareFunc)
- func StaticMiddlewareFromDir(dir http.FileSystem, options ...StaticOption) func(web.ResponseWriter, *web.Request, web.NextMiddlewareFunc)
- type Account
- func FetchAccountByDomain(ctx ContextInterface, domain string) (*Account, error)
- func FetchAccountById(ctx ContextInterface, id string) (*Account, error)
- func GetAllAccounts(ctx ContextInterface) ([]Account, error)
- func NewAccount(ctx ContextInterface) (*Account, error)
- func NewAccountWithData(ctx ContextInterface, req *web.Request) (*Account, error)
- func (a *Account) Delete() error
- func (a *Account) GetCreatedAt() string
- func (a *Account) GetDeletedAt() string
- func (a *Account) GetDomain() string
- func (a *Account) GetId() string
- func (a *Account) GetUpdatedAt() string
- func (a *Account) Hydrate(req *web.Request) error
- func (a *Account) Insert() error
- func (a *Account) IsValid() error
- func (a *Account) ProcessSubmit(req *web.Request) (string, bool, error)
- func (a *Account) Save() error
- func (a *Account) SetCreatedAt(val string)
- func (a *Account) SetDefaults()
- func (a *Account) SetDeletedAt(val string)
- func (a *Account) SetDomain(val string)
- func (a *Account) SetId(val string)
- func (a *Account) SetUpdatedAt(val string)
- func (a *Account) Undelete() error
- func (a *Account) Update() error
- type ContextInterface
- type DataValues
- type GzipByter
- type JobExample
- type JobFactoryExample
- type JobFactoryInterface
- type JobInterface
- type JobQueue
- type JobQueueNativeStore
- type JobQueueStoreInterface
- type NotWorthGzipCompressing
- type QueryIntBuilder
- type QueueJob
- func (qj *QueueJob) Checkin(status string) error
- func (qj *QueueJob) Delete() error
- func (qj *QueueJob) End() error
- func (qj *QueueJob) Fail(err error) error
- func (qj *QueueJob) GetAccountId() string
- func (qj *QueueJob) GetCheckinAt() string
- func (qj *QueueJob) GetData() string
- func (qj *QueueJob) GetDataValues() (url.Values, error)
- func (qj *QueueJob) GetDescription() string
- func (qj *QueueJob) GetEndedAt() string
- func (qj *QueueJob) GetError() string
- func (qj *QueueJob) GetId() string
- func (qj *QueueJob) GetName() string
- func (qj *QueueJob) GetPriority() string
- func (qj *QueueJob) GetQueuedAt() string
- func (qj *QueueJob) GetStartedAt() string
- func (qj *QueueJob) GetStatus() string
- func (qj *QueueJob) Hydrate(req *web.Request) error
- func (qj *QueueJob) Insert() error
- func (qj *QueueJob) IsValid() error
- func (qj *QueueJob) ProcessSubmit(req *web.Request) (string, bool, error)
- func (qj *QueueJob) Save() error
- func (qj *QueueJob) SetAccountId(val string)
- func (qj *QueueJob) SetCheckinAt(val string)
- func (qj *QueueJob) SetData(val string)
- func (qj *QueueJob) SetDefaults()
- func (qj *QueueJob) SetDescription(val string)
- func (qj *QueueJob) SetEndedAt(val string)
- func (qj *QueueJob) SetError(val string)
- func (qj *QueueJob) SetId(val string)
- func (qj *QueueJob) SetName(val string)
- func (qj *QueueJob) SetPriority(val string)
- func (qj *QueueJob) SetQueuedAt(val string)
- func (qj *QueueJob) SetStartedAt(val string)
- func (qj *QueueJob) SetStatus(val string)
- func (qj *QueueJob) Start() error
- func (qj *QueueJob) Update() error
- type SearchParams
- type Shard
- func CreateShardByName(ctx ContextInterface, shardName string) (*Shard, error)
- func FetchBestShard(ctx ContextInterface) (*Shard, error)
- func FetchShardByAccountId(ctx ContextInterface, accountId string) (*Shard, error)
- func FetchShardByDomain(ctx ContextInterface, email string) (*Shard, error)
- func FetchShardByEmail(ctx ContextInterface, email string) (*Shard, error)
- func FetchShardById(ctx ContextInterface, id string) (*Shard, error)
- func FetchShardByName(ctx ContextInterface, shardName string) (*Shard, error)
- func GetAllShards(ctx ContextInterface) ([]Shard, error)
- func GetShardByAccountId(ctx ContextInterface, accountId string) (*Shard, error)
- func NewShard(ctx ContextInterface) (*Shard, error)
- func NewShardWithData(ctx ContextInterface, req *web.Request) (*Shard, error)
- func (s *Shard) Delete() error
- func (s *Shard) GetAccountCount() string
- func (s *Shard) GetCreatedAt() string
- func (s *Shard) GetDeletedAt() string
- func (s *Shard) GetId() string
- func (s *Shard) GetName() string
- func (s *Shard) GetUpdatedAt() string
- func (s *Shard) Hydrate(req *web.Request) error
- func (s *Shard) Insert() error
- func (s *Shard) IsValid() error
- func (s *Shard) NewWebContext() (ContextInterface, error)
- func (s *Shard) ProcessSubmit(req *web.Request) (string, bool, error)
- func (s *Shard) Save() error
- func (s *Shard) SetAccountCount(val string)
- func (s *Shard) SetCreatedAt(val string)
- func (s *Shard) SetDefaults()
- func (s *Shard) SetDeletedAt(val string)
- func (s *Shard) SetId(val string)
- func (s *Shard) SetName(val string)
- func (s *Shard) SetUpdatedAt(val string)
- func (s *Shard) Undelete() error
- func (s *Shard) Update() error
- type ShardMap
- func CreateShardMap(ctx ContextInterface, shardId string, domain string, accountId string) (*ShardMap, error)
- func FetchShardMapByAccountId(ctx ContextInterface, accountId string) (*ShardMap, error)
- func FetchShardMapByDomainAccountId(ctx ContextInterface, domain string, accountId string) (*ShardMap, error)
- func FetchShardMapById(ctx ContextInterface, id string) (*ShardMap, error)
- func GetAllShardMaps(ctx ContextInterface) ([]ShardMap, error)
- func NewShardMap(ctx ContextInterface) (*ShardMap, error)
- func NewShardMapWithData(ctx ContextInterface, req *web.Request) (*ShardMap, error)
- func (sm *ShardMap) Delete() error
- func (sm *ShardMap) GetAccountId() string
- func (sm *ShardMap) GetCreatedAt() string
- func (sm *ShardMap) GetDeletedAt() string
- func (sm *ShardMap) GetDomain() string
- func (sm *ShardMap) GetId() string
- func (sm *ShardMap) GetShardId() string
- func (sm *ShardMap) GetUpdatedAt() string
- func (sm *ShardMap) Hydrate(req *web.Request) error
- func (sm *ShardMap) Insert() error
- func (sm *ShardMap) IsValid() error
- func (sm *ShardMap) ProcessSubmit(req *web.Request) (string, bool, error)
- func (sm *ShardMap) Save() error
- func (sm *ShardMap) SetAccountId(val string)
- func (sm *ShardMap) SetCreatedAt(val string)
- func (sm *ShardMap) SetDefaults()
- func (sm *ShardMap) SetDeletedAt(val string)
- func (sm *ShardMap) SetDomain(val string)
- func (sm *ShardMap) SetId(val string)
- func (sm *ShardMap) SetShardId(val string)
- func (sm *ShardMap) SetUpdatedAt(val string)
- func (sm *ShardMap) Undelete() error
- func (sm *ShardMap) Update() error
- type StaticOption
- type SystemDbUpdate
- func CreateSystemDbUpdateByUpdateName(ctx ContextInterface, updateName string) (*SystemDbUpdate, error)
- func CreateSystemDbUpdateNoContext(updateName string, desc string) *SystemDbUpdate
- func FetchSystemDbUpdateById(ctx ContextInterface, id string) (*SystemDbUpdate, error)
- func FetchSystemDbUpdateByUpdateName(ctx ContextInterface, updateName string) (*SystemDbUpdate, error)
- func NewSystemDbUpdate(ctx ContextInterface) (*SystemDbUpdate, error)
- func NewSystemDbUpdateWithData(ctx ContextInterface, req *web.Request) (*SystemDbUpdate, error)
- func (sdu *SystemDbUpdate) Clone() SystemDbUpdateInterface
- func (sdu *SystemDbUpdate) Delete() error
- func (sdu *SystemDbUpdate) GetCreatedAt() string
- func (sdu *SystemDbUpdate) GetDescription() string
- func (sdu *SystemDbUpdate) GetId() string
- func (sdu *SystemDbUpdate) GetUpdateName() string
- func (sdu *SystemDbUpdate) Hydrate(req *web.Request) error
- func (sdu *SystemDbUpdate) Insert() error
- func (sdu *SystemDbUpdate) IsValid() error
- func (sdu *SystemDbUpdate) NeedsToRun() (bool, error)
- func (sdu *SystemDbUpdate) ProcessSubmit(req *web.Request) (string, bool, error)
- func (sdu *SystemDbUpdate) Run() error
- func (sdu *SystemDbUpdate) Save() error
- func (sdu *SystemDbUpdate) SetComplete() error
- func (sdu *SystemDbUpdate) SetContext(ctx ContextInterface)
- func (sdu *SystemDbUpdate) SetCreatedAt(val string)
- func (sdu *SystemDbUpdate) SetDefaults()
- func (sdu *SystemDbUpdate) SetDescription(val string)
- func (sdu *SystemDbUpdate) SetId(val string)
- func (sdu *SystemDbUpdate) SetUpdateName(val string)
- func (sdu *SystemDbUpdate) Update() error
- type SystemDbUpdateInterface
- type SystemDbUpdater
- func (sdu *SystemDbUpdater) GetDbUpdateInfo() (map[string][]SystemDbUpdateInterface, error)
- func (sdu *SystemDbUpdater) MergeErrors(cs ...<-chan error) <-chan error
- func (sdu *SystemDbUpdater) Run(update SystemDbUpdateInterface, dbName string) error
- func (sdu *SystemDbUpdater) RunAll() error
- func (sdu *SystemDbUpdater) RunAllByDbSession(dbSess *dbr.Session, dbName string) <-chan error
- func (sdu *SystemDbUpdater) SetDebug(debug bool)
- func (sdu *SystemDbUpdater) WaitForPipeline(errs ...<-chan error) error
- type User
- func FetchAllUserByAccountId(ctx ContextInterface, accountId string) ([]User, error)
- func FetchUserByEmail(ctx ContextInterface, email string) (*User, error)
- func FetchUserById(ctx ContextInterface, id string) (*User, error)
- func FetchUserByShardEmail(ctx ContextInterface, email string) (*User, error)
- func NewUser(ctx ContextInterface) (*User, error)
- func NewUserWithData(ctx ContextInterface, req *web.Request) (*User, error)
- func (u *User) Authenticate(password string) bool
- func (u *User) Delete() error
- func (u *User) EmailPreviouslyVerified() bool
- func (u *User) GetAccountId() string
- func (u *User) GetCreatedAt() string
- func (u *User) GetDeletedAt() string
- func (u *User) GetEmail() string
- func (u *User) GetFirstName() string
- func (u *User) GetId() string
- func (u *User) GetLastName() string
- func (u *User) GetPassword() string
- func (u *User) GetRoleId() string
- func (u *User) GetUpdatedAt() string
- func (u *User) GetVerifiedAt() string
- func (u *User) Hydrate(req *web.Request) error
- func (u *User) Insert() error
- func (u *User) IsValid() error
- func (u *User) ProcessSubmit(req *web.Request) (string, bool, error)
- func (u *User) Save() error
- func (u *User) SetAccountId(val string)
- func (u *User) SetCreatedAt(val string)
- func (u *User) SetDefaults()
- func (u *User) SetDeletedAt(val string)
- func (u *User) SetEmail(val string)
- func (u *User) SetFirstName(val string)
- func (u *User) SetFromSession() error
- func (u *User) SetId(val string)
- func (u *User) SetLastName(val string)
- func (u *User) SetPassword(password string, verifyPassword string)
- func (u *User) SetRoleId(val string)
- func (u *User) SetUpdatedAt(val string)
- func (u *User) SetVerifiedAt(val string)
- func (u *User) Undelete() error
- func (u *User) Update() error
- func (u *User) UserShardMapIsValid() (bool, string, error)
- func (u *User) VerifyEmail(token string) (bool, error)
- type WebContext
- func (ctx *WebContext) AjaxRequireUser(rw web.ResponseWriter, req *web.Request, next web.NextMiddlewareFunc)
- func (ctx *WebContext) Begin() (*dbr.Tx, error)
- func (ctx *WebContext) BeginTransaction(rw web.ResponseWriter, req *web.Request, next web.NextMiddlewareFunc)
- func (ctx *WebContext) Commit() error
- func (ctx *WebContext) DeleteFrom(table string) *dbr.DeleteStmt
- func (ctx *WebContext) FinishTransaction() error
- func (ctx *WebContext) GetDb() *jgoWebDb.Collection
- func (ctx *WebContext) GetDbSession() *dbr.Session
- func (ctx *WebContext) GetTemplate(filename string) (*template.Template, error)
- func (ctx *WebContext) GetValidator() *validator.Validate
- func (ctx *WebContext) InitDbSession()
- func (ctx *WebContext) InsertBySql(query string, value ...interface{}) *dbr.InsertStmt
- func (ctx *WebContext) InsertInto(table string) *dbr.InsertStmt
- func (ctx *WebContext) JobError(errorTitle string, err error, codeList ...string)
- func (ctx *WebContext) JobSuccess(codeList ...string)
- func (ctx *WebContext) JobWarning(title string, err error, codeList ...string)
- func (ctx *WebContext) JsonErrorResponse(rw web.ResponseWriter, code int, err error)
- func (ctx *WebContext) JsonEventErrorResponse(rw web.ResponseWriter, code int, msg string)
- func (ctx *WebContext) JsonOkResponse(rw web.ResponseWriter, code int, message string)
- func (ctx *WebContext) JsonResponse(rw web.ResponseWriter, code int, payload string)
- func (ctx *WebContext) LoadDi(rw web.ResponseWriter, req *web.Request, next web.NextMiddlewareFunc)
- func (ctx *WebContext) LoadEndPoint(rw web.ResponseWriter, req *web.Request, next web.NextMiddlewareFunc)
- func (ctx *WebContext) LoadJob(rw web.ResponseWriter, req *web.Request, next web.NextMiddlewareFunc)
- func (ctx *WebContext) LoadSession(rw web.ResponseWriter, req *web.Request, next web.NextMiddlewareFunc)
- func (ctx *WebContext) LoadTemplate(rw web.ResponseWriter, req *web.Request, next web.NextMiddlewareFunc)
- func (ctx *WebContext) OptionalBegin() (*dbr.Tx, error)
- func (ctx *WebContext) OptionalCommit(tx *dbr.Tx) error
- func (ctx *WebContext) OptionalRollback(tx *dbr.Tx) error
- func (ctx *WebContext) Prepare(query string) (*sql.Stmt, error)
- func (ctx *WebContext) RequireUser(rw web.ResponseWriter, req *web.Request, next web.NextMiddlewareFunc)
- func (ctx *WebContext) Rollback() error
- func (ctx *WebContext) Select(column ...string) *dbr.SelectBuilder
- func (ctx *WebContext) SelectBySql(query string, value ...interface{}) *dbr.SelectBuilder
- func (ctx *WebContext) SessionGetString(key string) (string, error)
- func (ctx *WebContext) SessionPutString(rw web.ResponseWriter, key string, value string)
- func (ctx *WebContext) SetDbSession(dbSess *dbr.Session)
- func (ctx *WebContext) SetJobSuccessRollback(rw web.ResponseWriter, req *web.Request, next web.NextMiddlewareFunc)
- func (ctx *WebContext) SetUser(user *User)
- func (ctx *WebContext) Update(table string) *dbr.UpdateStmt
- func (ctx *WebContext) UpdateBySql(query string, value ...interface{}) *dbr.UpdateStmt
- func (ctx *WebContext) UpdateWebMetrics(code string)
- func (c *WebContext) Welcome(rw web.ResponseWriter, req *web.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertResponse ¶
func AssertResponse(t *testing.T, rr *httptest.ResponseRecorder, code int)
func ClusterAddShard ¶
func ClusterAddShard(ctx ContextInterface, shardName string) error
func ClusterAddShardMap ¶
func ClusterAddShardMap(ctx ContextInterface, shardId string, domain string, accountId string) error
func ClusterDeleteShard ¶
func ClusterDeleteShard(ctx ContextInterface, shardName string) error
func ClusterGetAccounts ¶
func ClusterGetAccounts(ctx ContextInterface) (map[string][]Account, error)
Get account data for all DBs
func ClusterGetShards ¶
func ClusterGetShards(ctx ContextInterface) (map[string][]Shard, error)
Get shard data for all DBs
func ClusterUndeleteShard ¶
func ClusterUndeleteShard(ctx ContextInterface, shardName string) error
func CreateAccount ¶
func CreateAccount(ctx ContextInterface, shardName string, domain string) error
func GetAppConfig ¶
func GetConfigEnvVar ¶
func GetConfigEnvVar() string
func GetConfigPath ¶
func GetConfigPath() string
func GetDefaultWebRouter ¶
func GetSessionManager ¶
func GzipServeContent ¶
func GzipServeContent(w http.ResponseWriter, req *http.Request, name string, modTime time.Time, content io.ReadSeeker)
ServeContent is like http.ServeContent, except it applies gzip compression if compression hasn't already been done (i.e., the "Content-Encoding" header is set). It's aware of GzipByter and NotWorthGzipCompressing interfaces, and uses them to improve performance when the provided content implements them. Otherwise, it applies gzip compression on the fly, if it's found to be beneficial.
func InitMockAccount ¶
func InitMockAccount()
func InitMockCtx ¶
func InitMockCtx()
func InitMockQueueJob ¶
func InitMockQueueJob()
func InitMockShard ¶
func InitMockShard()
func InitMockShardMap ¶
func InitMockShardMap()
func InitMockSystemDbUpdate ¶
func InitMockSystemDbUpdate()
func InitMockUser ¶
func InitMockUser()
func NewTestRequest ¶
func NewTestRequest(method, path string, body io.Reader) (*httptest.ResponseRecorder, *http.Request)
Make a testing request (lifted/modified from gocraft/web)
func SetConfigEnvVar ¶
func SetConfigEnvVar(envVar string)
func SetConfigPath ¶
func SetConfigPath(path string)
func StartHttpServer ¶
func StartHttpsServer ¶
Start a HTTPS server that auto updates SSL certs via ACME
func StaticMiddleware ¶
func StaticMiddleware(path string, option ...StaticOption) func(web.ResponseWriter, *web.Request, web.NextMiddlewareFunc)
StaticMiddleware is the same as StaticMiddlewareFromDir, but accepts a path string for backwards compatibility.
func StaticMiddlewareFromDir ¶
func StaticMiddlewareFromDir(dir http.FileSystem, options ...StaticOption) func(web.ResponseWriter, *web.Request, web.NextMiddlewareFunc)
StaticMiddlewareFromDir returns a middleware that serves static files from the specified http.FileSystem. This middleware is great for development because each file is read from disk each time and no special caching or cache headers are sent.
If a path is requested which maps to a folder with an index.html folder on your filesystem, then that index.html file will be served.
Types ¶
type Account ¶
type Account struct {
Id sql.NullString `json:"Id" validate:"omitempty,uuid"`
Domain sql.NullString `json:"Domain" validate:"required"`
CreatedAt sql.NullString `json:"CreatedAt" validate:"omitempty,rfc3339"`
UpdatedAt sql.NullString `json:"UpdatedAt" validate:"omitempty,rfc3339"`
DeletedAt sql.NullString `json:"DeletedAt" validate:"omitempty,rfc3339"`
Ctx ContextInterface `json:"-" validate:"-"`
}
Account
var MockAccount *Account
func FetchAccountByDomain ¶
func FetchAccountByDomain(ctx ContextInterface, domain string) (*Account, error)
func FetchAccountById ¶
func FetchAccountById(ctx ContextInterface, id string) (*Account, error)
Factory Method
func GetAllAccounts ¶
func GetAllAccounts(ctx ContextInterface) ([]Account, error)
func NewAccountWithData ¶
func NewAccountWithData(ctx ContextInterface, req *web.Request) (*Account, error)
New model with data
func (*Account) GetCreatedAt ¶
func (*Account) GetDeletedAt ¶
func (*Account) GetUpdatedAt ¶
func (*Account) ProcessSubmit ¶
func (*Account) SetCreatedAt ¶
func (*Account) SetDeletedAt ¶
func (*Account) SetUpdatedAt ¶
type ContextInterface ¶
type ContextInterface interface {
Begin() (*dbr.Tx, error)
Commit() error
Rollback() error
Select(column ...string) *dbr.SelectBuilder
SelectBySql(query string, value ...interface{}) *dbr.SelectBuilder
Prepare(query string) (*sql.Stmt, error)
InsertBySql(query string, value ...interface{}) *dbr.InsertStmt
InsertInto(table string) *dbr.InsertStmt
UpdateBySql(query string, value ...interface{}) *dbr.UpdateStmt
Update(table string) *dbr.UpdateStmt
OptionalBegin() (*dbr.Tx, error)
OptionalRollback(tx *dbr.Tx) error
OptionalCommit(tx *dbr.Tx) error
FinishTransaction() error
DeleteFrom(table string) *dbr.DeleteStmt
SetUser(user *User)
SessionGetString(key string) (string, error)
SessionPutString(rw web.ResponseWriter, key string, value string)
GetDb() *jgoWebDb.Collection
GetDbSession() *dbr.Session
SetDbSession(dbSess *dbr.Session)
GetValidator() *validator.Validate
GetTemplate(filename string) (*template.Template, error)
}
type DataValues ¶
DataValues
type GzipByter ¶
type GzipByter interface {
// GzipBytes returns gzip compressed contents of the file.
GzipBytes() []byte
}
GzipByter is implemented by compressed files for efficient direct access to the internal compressed bytes.
type JobExample ¶
type JobExample struct {
NumSleeps int
Done chan bool
Checkin chan bool
// contains filtered or unexported fields
}
func NewJobExample ¶
func NewJobExample() *JobExample
func (*JobExample) GetCheckinChannel ¶
func (j *JobExample) GetCheckinChannel() chan bool
func (*JobExample) GetDoneChannel ¶
func (j *JobExample) GetDoneChannel() chan bool
func (*JobExample) GetError ¶
func (j *JobExample) GetError() error
func (*JobExample) GetStatus ¶
func (j *JobExample) GetStatus() string
func (*JobExample) IsDone ¶
func (j *JobExample) IsDone() bool
func (*JobExample) Quit ¶
func (j *JobExample) Quit()
func (*JobExample) Run ¶
func (j *JobExample) Run() error
type JobFactoryExample ¶
type JobFactoryExample struct{}
func (*JobFactoryExample) New ¶
func (jf *JobFactoryExample) New(ctx ContextInterface, name string, params url.Values) (JobInterface, error)
type JobFactoryInterface ¶
type JobFactoryInterface interface {
New(ContextInterface, string, url.Values) (JobInterface, error)
}
type JobInterface ¶
type JobQueue ¶
type JobQueue struct {
ProcessInterval int
SchedJob *scheduler.Job
Debug bool
Ctx ContextInterface
// contains filtered or unexported fields
}
func NewJobQueue ¶
func NewJobQueue(ctx ContextInterface, dataStore JobQueueStoreInterface, factory JobFactoryInterface) (*JobQueue, error)
func (*JobQueue) NewContext ¶
func (jq *JobQueue) NewContext() ContextInterface
func (*JobQueue) ProcessJobs ¶
type JobQueueNativeStore ¶
type JobQueueNativeStore struct {
Ctx ContextInterface
MaxConcurrency uint64
MaxBatch uint64
MaxMem uint64
}
func NewJobQueueNativeStore ¶
func NewJobQueueNativeStore(ctx ContextInterface) (*JobQueueNativeStore, error)
func (*JobQueueNativeStore) ByteToMb ¶
func (jqs *JobQueueNativeStore) ByteToMb(b uint64) uint64
func (*JobQueueNativeStore) EnqueueJob ¶
func (jqs *JobQueueNativeStore) EnqueueJob(job *QueueJob) error
func (*JobQueueNativeStore) GetNextJobs ¶
func (jqs *JobQueueNativeStore) GetNextJobs() ([]QueueJob, error)
func (*JobQueueNativeStore) GetRunningJobs ¶
func (jqs *JobQueueNativeStore) GetRunningJobs() uint64
func (*JobQueueNativeStore) IsMemExceeded ¶
func (jqs *JobQueueNativeStore) IsMemExceeded() bool
type JobQueueStoreInterface ¶
type NotWorthGzipCompressing ¶
type NotWorthGzipCompressing interface {
// NotWorthGzipCompressing is a noop. It's implemented in order to indicate
// the file is not worth gzip compressing.
NotWorthGzipCompressing()
}
NotWorthGzipCompressing is implemented by files that were determined not to be worth gzip compressing (the file size did not decrease as a result).
type QueryIntBuilder ¶
type QueryIntBuilder struct {
Query string
RawQuery string
InvalidQuery string
// contains filtered or unexported fields
}
func NewQueryIntBuilder ¶
func NewQueryIntBuilder(ctx ContextInterface, rawQuery string) *QueryIntBuilder
func (*QueryIntBuilder) Build ¶
func (b *QueryIntBuilder) Build() (string, error)
@TODO: auto fix invalid query strings? Improve logic like crazy? Beter validation?
func (*QueryIntBuilder) GetOperator ¶
func (b *QueryIntBuilder) GetOperator(rawQuery string) string
func (*QueryIntBuilder) GetQuery ¶
func (b *QueryIntBuilder) GetQuery(rawQuery string) (string, error)
func (*QueryIntBuilder) IsValid ¶
func (b *QueryIntBuilder) IsValid() bool
func (*QueryIntBuilder) Parse ¶
func (b *QueryIntBuilder) Parse() string
type QueueJob ¶
type QueueJob struct {
Id sql.NullString `json:"Id" validate:"omitempty,uuid"`
AccountId sql.NullString `json:"AccountId" validate:"required,uuid"`
Name sql.NullString `json:"Name" validate:"required,min=1,max=255"`
Description sql.NullString `json:"Description" validate:"required,min=1,max=255"`
Priority sql.NullString `json:"Priority" validate:"omitempty,int"`
Data sql.NullString `json:"Data" validate:"omitempty"`
Status sql.NullString `json:"Status" validate:"omitempty,min=1,max=255"`
QueuedAt sql.NullString `json:"QueuedAt" validate:"omitempty,rfc3339"`
StartedAt sql.NullString `json:"StartedAt" validate:"omitempty,rfc3339"`
CheckinAt sql.NullString `json:"CheckinAt" validate:"omitempty,rfc3339"`
EndedAt sql.NullString `json:"EndedAt" validate:"omitempty,rfc3339"`
Error sql.NullString `json:"Error" validate:"omitempty"`
Ctx ContextInterface `json:"-" validate:"-"`
}
QueueJob
var MockQueueJob *QueueJob
func FetchQueueJobById ¶
func FetchQueueJobById(ctx ContextInterface, id string) (*QueueJob, error)
Factory Method
func NewQueueJobWithData ¶
func NewQueueJobWithData(ctx ContextInterface, req *web.Request) (*QueueJob, error)
New model with data
func (*QueueJob) GetAccountId ¶
func (*QueueJob) GetCheckinAt ¶
func (*QueueJob) GetDescription ¶
func (*QueueJob) GetEndedAt ¶
func (*QueueJob) GetPriority ¶
func (*QueueJob) GetQueuedAt ¶
func (*QueueJob) GetStartedAt ¶
func (*QueueJob) ProcessSubmit ¶
func (*QueueJob) SetAccountId ¶
func (*QueueJob) SetCheckinAt ¶
func (*QueueJob) SetDescription ¶
func (*QueueJob) SetEndedAt ¶
func (*QueueJob) SetPriority ¶
func (*QueueJob) SetQueuedAt ¶
func (*QueueJob) SetStartedAt ¶
type SearchParams ¶
type SearchParams struct {
Query string
Limit uint64
Offset uint64
TableAlias string
FirstName string
LastName string
IdField string
UrlParams url.Values
}
func NewSearchParams ¶
func NewSearchParams() *SearchParams
func (*SearchParams) BuildDefaultCondition ¶
func (sp *SearchParams) BuildDefaultCondition() (dbr.Builder, error)
type Shard ¶
type Shard struct {
Id sql.NullString `json:"Id" validate:"omitempty,int"`
Name sql.NullString `json:"Name" validate:"required"`
AccountCount sql.NullString `json:"AccountCount" validate:"required,int"`
CreatedAt sql.NullString `json:"CreatedAt" validate:"omitempty,rfc3339"`
UpdatedAt sql.NullString `json:"UpdatedAt" validate:"omitempty,rfc3339"`
DeletedAt sql.NullString `json:"DeletedAt" validate:"omitempty,rfc3339"`
Ctx ContextInterface `json:"-" validate:"-"`
}
Shard
var MockShard *Shard
func CreateShardByName ¶
func CreateShardByName(ctx ContextInterface, shardName string) (*Shard, error)
func FetchBestShard ¶
func FetchBestShard(ctx ContextInterface) (*Shard, error)
func FetchShardByAccountId ¶
func FetchShardByAccountId(ctx ContextInterface, accountId string) (*Shard, error)
func FetchShardByDomain ¶
func FetchShardByDomain(ctx ContextInterface, email string) (*Shard, error)
func FetchShardByEmail ¶
func FetchShardByEmail(ctx ContextInterface, email string) (*Shard, error)
func FetchShardById ¶
func FetchShardById(ctx ContextInterface, id string) (*Shard, error)
Factory Method
func FetchShardByName ¶
func FetchShardByName(ctx ContextInterface, shardName string) (*Shard, error)
Does not set db session. Mainly used for logical replication of shards.
func GetAllShards ¶
func GetAllShards(ctx ContextInterface) ([]Shard, error)
func GetShardByAccountId ¶
func GetShardByAccountId(ctx ContextInterface, accountId string) (*Shard, error)
Does not alter web context... These fetches/gets are a bit confusing :/ Be careful
func NewShardWithData ¶
func NewShardWithData(ctx ContextInterface, req *web.Request) (*Shard, error)
New model with data
func (*Shard) GetAccountCount ¶
func (*Shard) GetCreatedAt ¶
func (*Shard) GetDeletedAt ¶
func (*Shard) GetUpdatedAt ¶
func (*Shard) NewWebContext ¶
func (s *Shard) NewWebContext() (ContextInterface, error)
func (*Shard) SetAccountCount ¶
func (*Shard) SetCreatedAt ¶
func (*Shard) SetDeletedAt ¶
func (*Shard) SetUpdatedAt ¶
type ShardMap ¶
type ShardMap struct {
Id sql.NullString `json:"Id" validate:"omitempty,int"`
ShardId sql.NullString `json:"ShardId" validate:"required,int"`
Domain sql.NullString `json:"Domain" validate:"required"`
AccountId sql.NullString `json:"AccountId" validate:"required,uuid"`
CreatedAt sql.NullString `json:"CreatedAt" validate:"omitempty,rfc3339"`
UpdatedAt sql.NullString `json:"UpdatedAt" validate:"omitempty,rfc3339"`
DeletedAt sql.NullString `json:"DeletedAt" validate:"omitempty,rfc3339"`
Ctx ContextInterface `json:"-" validate:"-"`
}
ShardMap
var MockShardMap *ShardMap
func CreateShardMap ¶
func FetchShardMapByAccountId ¶
func FetchShardMapByAccountId(ctx ContextInterface, accountId string) (*ShardMap, error)
Factory Method
func FetchShardMapByDomainAccountId ¶
func FetchShardMapByDomainAccountId(ctx ContextInterface, domain string, accountId string) (*ShardMap, error)
Factory Method
func FetchShardMapById ¶
func FetchShardMapById(ctx ContextInterface, id string) (*ShardMap, error)
Factory Method
func GetAllShardMaps ¶
func GetAllShardMaps(ctx ContextInterface) ([]ShardMap, error)
Ignore "deleted" shards
func NewShardMapWithData ¶
func NewShardMapWithData(ctx ContextInterface, req *web.Request) (*ShardMap, error)
New model with data
func (*ShardMap) GetAccountId ¶
func (*ShardMap) GetCreatedAt ¶
func (*ShardMap) GetDeletedAt ¶
func (*ShardMap) GetShardId ¶
func (*ShardMap) GetUpdatedAt ¶
func (*ShardMap) ProcessSubmit ¶
func (*ShardMap) SetAccountId ¶
func (*ShardMap) SetCreatedAt ¶
func (*ShardMap) SetDeletedAt ¶
func (*ShardMap) SetShardId ¶
func (*ShardMap) SetUpdatedAt ¶
type StaticOption ¶
StaticOption configures how StaticMiddlewareDir handles url paths and index files for directories. If set, Prefix is removed from the start of the url path before attempting to serve a directory or file. If set, IndexFile is the index file to serve when the url path maps to a directory.
type SystemDbUpdate ¶
type SystemDbUpdate struct {
ApplyUpdate func(ctx ContextInterface) error `json:"-" validate:"-"`
Id sql.NullString `json:"Id" validate:"omitempty,int"`
UpdateName sql.NullString `json:"UpdateName" validate:"required,min=1,max=255"`
Description sql.NullString `json:"Description" validate:"required,min=1,max=255"`
CreatedAt sql.NullString `json:"CreatedAt" validate:"omitempty,rfc3339"`
Ctx ContextInterface `json:"-" validate:"-"`
}
SystemDbUpdate
var MockSystemDbUpdate *SystemDbUpdate
func CreateSystemDbUpdateByUpdateName ¶
func CreateSystemDbUpdateByUpdateName(ctx ContextInterface, updateName string) (*SystemDbUpdate, error)
Factory Method
func CreateSystemDbUpdateNoContext ¶
func CreateSystemDbUpdateNoContext(updateName string, desc string) *SystemDbUpdate
Empty new update
func FetchSystemDbUpdateById ¶
func FetchSystemDbUpdateById(ctx ContextInterface, id string) (*SystemDbUpdate, error)
Factory Method
func FetchSystemDbUpdateByUpdateName ¶
func FetchSystemDbUpdateByUpdateName(ctx ContextInterface, updateName string) (*SystemDbUpdate, error)
Factory Method
func NewSystemDbUpdate ¶
func NewSystemDbUpdate(ctx ContextInterface) (*SystemDbUpdate, error)
Empty new model
func NewSystemDbUpdateWithData ¶
func NewSystemDbUpdateWithData(ctx ContextInterface, req *web.Request) (*SystemDbUpdate, error)
New model with data
func (*SystemDbUpdate) Clone ¶
func (sdu *SystemDbUpdate) Clone() SystemDbUpdateInterface
func (*SystemDbUpdate) GetCreatedAt ¶
func (sdu *SystemDbUpdate) GetCreatedAt() string
func (*SystemDbUpdate) GetDescription ¶
func (sdu *SystemDbUpdate) GetDescription() string
func (*SystemDbUpdate) GetId ¶
func (sdu *SystemDbUpdate) GetId() string
func (*SystemDbUpdate) GetUpdateName ¶
func (sdu *SystemDbUpdate) GetUpdateName() string
func (*SystemDbUpdate) Hydrate ¶
func (sdu *SystemDbUpdate) Hydrate(req *web.Request) error
Hydrate the model with data
func (*SystemDbUpdate) NeedsToRun ¶
func (sdu *SystemDbUpdate) NeedsToRun() (bool, error)
func (*SystemDbUpdate) ProcessSubmit ¶
func (*SystemDbUpdate) Run ¶
func (sdu *SystemDbUpdate) Run() error
func (*SystemDbUpdate) Save ¶
func (sdu *SystemDbUpdate) Save() error
Insert/Update based on pkey value
func (*SystemDbUpdate) SetComplete ¶
func (sdu *SystemDbUpdate) SetComplete() error
func (*SystemDbUpdate) SetContext ¶
func (sdu *SystemDbUpdate) SetContext(ctx ContextInterface)
func (*SystemDbUpdate) SetCreatedAt ¶
func (sdu *SystemDbUpdate) SetCreatedAt(val string)
func (*SystemDbUpdate) SetDescription ¶
func (sdu *SystemDbUpdate) SetDescription(val string)
func (*SystemDbUpdate) SetId ¶
func (sdu *SystemDbUpdate) SetId(val string)
func (*SystemDbUpdate) SetUpdateName ¶
func (sdu *SystemDbUpdate) SetUpdateName(val string)
type SystemDbUpdateInterface ¶
type SystemDbUpdateInterface interface {
NeedsToRun() (bool, error)
Run() error
SetContext(ctx ContextInterface)
SetComplete() error
GetUpdateName() string
GetDescription() string
Clone() SystemDbUpdateInterface
}
type SystemDbUpdater ¶
type SystemDbUpdater struct {
Db *jgowebDb.Collection
DbUpdates []SystemDbUpdateInterface
DryRun bool
}
func NewSystemDbUpdater ¶
func NewSystemDbUpdater(db *jgowebDb.Collection, updates []SystemDbUpdateInterface, dryRun bool) *SystemDbUpdater
func (*SystemDbUpdater) GetDbUpdateInfo ¶
func (sdu *SystemDbUpdater) GetDbUpdateInfo() (map[string][]SystemDbUpdateInterface, error)
Get update info for all DBs
func (*SystemDbUpdater) MergeErrors ¶
func (sdu *SystemDbUpdater) MergeErrors(cs ...<-chan error) <-chan error
MergeErrors merges multiple channels of errors. Based on https://blog.golang.org/pipelines. Based on https://medium.com/statuscode/pipeline-patterns-in-go-a37bb3a7e61d
func (*SystemDbUpdater) Run ¶
func (sdu *SystemDbUpdater) Run(update SystemDbUpdateInterface, dbName string) error
func (*SystemDbUpdater) RunAll ¶
func (sdu *SystemDbUpdater) RunAll() error
func (*SystemDbUpdater) RunAllByDbSession ¶
func (sdu *SystemDbUpdater) RunAllByDbSession(dbSess *dbr.Session, dbName string) <-chan error
func (*SystemDbUpdater) SetDebug ¶
func (sdu *SystemDbUpdater) SetDebug(debug bool)
func (*SystemDbUpdater) WaitForPipeline ¶
func (sdu *SystemDbUpdater) WaitForPipeline(errs ...<-chan error) error
WaitForPipeline waits for results from all error channels.
type User ¶
type User struct {
Id sql.NullString `json:"Id" validate:"omitempty,uuid"`
AccountId sql.NullString `json:"AccountId" validate:"required,uuid"`
RoleId sql.NullString `json:"RoleId" validate:"required,int"`
FirstName sql.NullString `json:"FirstName" validate:"required"`
LastName sql.NullString `json:"LastName" validate:"required"`
Email sql.NullString `json:"Email" validate:"required"`
Password sql.NullString `json:"Password" validate:"required,min=1,max=255"`
CreatedAt sql.NullString `json:"CreatedAt" validate:"omitempty,rfc3339"`
DeletedAt sql.NullString `json:"DeletedAt" validate:"omitempty,rfc3339"`
UpdatedAt sql.NullString `json:"UpdatedAt" validate:"omitempty,rfc3339"`
VerifiedAt sql.NullString `json:"VerifiedAt" validate:"omitempty,rfc3339"`
Ctx ContextInterface `json:"-" validate:"-"`
CurrentPasswordError string `validate:"errorMsg"`
UserUniqueError string `validate:"errorMsg"`
RawPasswordError string `validate:"errorMsg"`
// contains filtered or unexported fields
}
User
var MockUser *User
These aren't true mocks. More like "test" structs
func FetchAllUserByAccountId ¶
func FetchAllUserByAccountId(ctx ContextInterface, accountId string) ([]User, error)
func FetchUserByEmail ¶
func FetchUserByEmail(ctx ContextInterface, email string) (*User, error)
func FetchUserById ¶
func FetchUserById(ctx ContextInterface, id string) (*User, error)
Factory Method
func FetchUserByShardEmail ¶
func FetchUserByShardEmail(ctx ContextInterface, email string) (*User, error)
func NewUserWithData ¶
func NewUserWithData(ctx ContextInterface, req *web.Request) (*User, error)
New model with data
func (*User) Authenticate ¶
func (*User) EmailPreviouslyVerified ¶
func (*User) GetAccountId ¶
func (*User) GetCreatedAt ¶
func (*User) GetDeletedAt ¶
func (*User) GetFirstName ¶
func (*User) GetLastName ¶
func (*User) GetPassword ¶
func (*User) GetUpdatedAt ¶
func (*User) GetVerifiedAt ¶
func (*User) SetAccountId ¶
func (*User) SetCreatedAt ¶
func (*User) SetDeletedAt ¶
func (*User) SetFirstName ¶
func (*User) SetLastName ¶
func (*User) SetPassword ¶
func (*User) SetUpdatedAt ¶
func (*User) SetVerifiedAt ¶
func (*User) UserShardMapIsValid ¶
Make sure user is connected to one account id in the shard_map @TODO: logic needs to be better... should not be able to create a 2nd user with the same email etc.
type WebContext ¶
type WebContext struct {
User *User
Session *scs.Session
Template *template.Template
Job *health.Job
Method string
StartTime time.Time
EndPoint string
Validate *validator.Validate
Db *jgoWebDb.Collection
DbSess *dbr.Session
Tx *dbr.Tx
RollbackTransaction bool
}
var MockCtx *WebContext
func NewContext ¶
func NewContext(db *jgoWebDb.Collection) *WebContext
func (*WebContext) AjaxRequireUser ¶
func (ctx *WebContext) AjaxRequireUser(rw web.ResponseWriter, req *web.Request, next web.NextMiddlewareFunc)
Auth middleware
func (*WebContext) BeginTransaction ¶
func (ctx *WebContext) BeginTransaction(rw web.ResponseWriter, req *web.Request, next web.NextMiddlewareFunc)
Have the context manage the DB transaction. Typically don't do this. Each model handles it's own transaction, which is much faster/safer than having a single transaction for an entire web request. This middleware is useful for testing routes though.
func (*WebContext) Commit ¶
func (ctx *WebContext) Commit() error
func (*WebContext) DeleteFrom ¶
func (ctx *WebContext) DeleteFrom(table string) *dbr.DeleteStmt
func (*WebContext) FinishTransaction ¶
func (ctx *WebContext) FinishTransaction() error
Complete the DB transaction if the web context is managing it.
func (*WebContext) GetDb ¶
func (ctx *WebContext) GetDb() *jgoWebDb.Collection
func (*WebContext) GetDbSession ¶
func (ctx *WebContext) GetDbSession() *dbr.Session
func (*WebContext) GetTemplate ¶
func (ctx *WebContext) GetTemplate(filename string) (*template.Template, error)
Get Template
func (*WebContext) GetValidator ¶
func (ctx *WebContext) GetValidator() *validator.Validate
func (*WebContext) InsertBySql ¶
func (ctx *WebContext) InsertBySql(query string, value ...interface{}) *dbr.InsertStmt
func (*WebContext) InsertInto ¶
func (ctx *WebContext) InsertInto(table string) *dbr.InsertStmt
func (*WebContext) JobError ¶
func (ctx *WebContext) JobError(errorTitle string, err error, codeList ...string)
health stream job error
func (*WebContext) JobSuccess ¶
func (ctx *WebContext) JobSuccess(codeList ...string)
health stream job success
func (*WebContext) JobWarning ¶
func (ctx *WebContext) JobWarning(title string, err error, codeList ...string)
health stream job warning
func (*WebContext) JsonErrorResponse ¶
func (ctx *WebContext) JsonErrorResponse(rw web.ResponseWriter, code int, err error)
write a JSON error response
func (*WebContext) JsonEventErrorResponse ¶
func (ctx *WebContext) JsonEventErrorResponse(rw web.ResponseWriter, code int, msg string)
write a JSON error response that's consistent with Javascript error events (i.e., {error: {message: "Error msg here"}})
func (*WebContext) JsonOkResponse ¶
func (ctx *WebContext) JsonOkResponse(rw web.ResponseWriter, code int, message string)
write a JSON error response
func (*WebContext) JsonResponse ¶
func (ctx *WebContext) JsonResponse(rw web.ResponseWriter, code int, payload string)
write a JSON response
func (*WebContext) LoadDi ¶
func (ctx *WebContext) LoadDi(rw web.ResponseWriter, req *web.Request, next web.NextMiddlewareFunc)
Various context dependancy injection (DbCollection, metrics, etc)
func (*WebContext) LoadEndPoint ¶
func (ctx *WebContext) LoadEndPoint(rw web.ResponseWriter, req *web.Request, next web.NextMiddlewareFunc)
EndPoint middleware Get endpoint for route (i.e., path = "/search/other/etc", endpoint = "search")
func (*WebContext) LoadJob ¶
func (ctx *WebContext) LoadJob(rw web.ResponseWriter, req *web.Request, next web.NextMiddlewareFunc)
HealthStream job middle ware for routes
func (*WebContext) LoadSession ¶
func (ctx *WebContext) LoadSession(rw web.ResponseWriter, req *web.Request, next web.NextMiddlewareFunc)
Session middleware
func (*WebContext) LoadTemplate ¶
func (ctx *WebContext) LoadTemplate(rw web.ResponseWriter, req *web.Request, next web.NextMiddlewareFunc)
Template middleware
func (*WebContext) OptionalBegin ¶
func (ctx *WebContext) OptionalBegin() (*dbr.Tx, error)
Only start a transaction if one hasn't been started yet
func (*WebContext) OptionalCommit ¶
func (ctx *WebContext) OptionalCommit(tx *dbr.Tx) error
Commit if there's no tx in the context
func (*WebContext) OptionalRollback ¶
func (ctx *WebContext) OptionalRollback(tx *dbr.Tx) error
Rollback if there's no tx in the context
func (*WebContext) RequireUser ¶
func (ctx *WebContext) RequireUser(rw web.ResponseWriter, req *web.Request, next web.NextMiddlewareFunc)
Auth middleware
func (*WebContext) Rollback ¶
func (ctx *WebContext) Rollback() error
func (*WebContext) Select ¶
func (ctx *WebContext) Select(column ...string) *dbr.SelectBuilder
func (*WebContext) SelectBySql ¶
func (ctx *WebContext) SelectBySql(query string, value ...interface{}) *dbr.SelectBuilder
func (*WebContext) SessionGetString ¶
func (ctx *WebContext) SessionGetString(key string) (string, error)
func (*WebContext) SessionPutString ¶
func (ctx *WebContext) SessionPutString(rw web.ResponseWriter, key string, value string)
func (*WebContext) SetDbSession ¶
func (ctx *WebContext) SetDbSession(dbSess *dbr.Session)
func (*WebContext) SetJobSuccessRollback ¶
func (ctx *WebContext) SetJobSuccessRollback(rw web.ResponseWriter, req *web.Request, next web.NextMiddlewareFunc)
Tell the web context to rollback it's transaction upon Job success This middleware is useful for testing routes.
func (*WebContext) SetUser ¶
func (ctx *WebContext) SetUser(user *User)
func (*WebContext) Update ¶
func (ctx *WebContext) Update(table string) *dbr.UpdateStmt
func (*WebContext) UpdateBySql ¶
func (ctx *WebContext) UpdateBySql(query string, value ...interface{}) *dbr.UpdateStmt
func (*WebContext) UpdateWebMetrics ¶
func (ctx *WebContext) UpdateWebMetrics(code string)
func (*WebContext) Welcome ¶
func (c *WebContext) Welcome(rw web.ResponseWriter, req *web.Request)