Documentation ¶
Index ¶
- Variables
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- type Service
- func (s *Service) Close()
- func (s *Service) GetConfig() *config.Config
- func (s *Service) GetOauthService() oauth.ServiceInterface
- func (s *Service) GetRoutes() []routes.Route
- func (s *Service) GetSessionService() session.ServiceInterface
- func (s *Service) RegisterRoutes(router *mux.Router, prefix string)
- type ServiceInterface
- type StringBuilder
- type UpdateUserForm
- func (f *UpdateUserForm) AddError(name, msg string)
- func (f *UpdateUserForm) Diff() map[string]interface{}
- func (f *UpdateUserForm) Error(name string) validator.FieldError
- func (f *UpdateUserForm) ErrorMsg(name string) string
- func (f *UpdateUserForm) ErrorStatus(name string) string
- func (f *UpdateUserForm) ErrorText(name string) string
- func (f *UpdateUserForm) Valid() bool
Constants ¶
This section is empty.
Variables ¶
var ( // ErrSessionServiceNotPresent ... ErrSessionServiceNotPresent = errors.New("Session service not present in the request context") // ErrClientNotPresent ... ErrClientNotPresent = errors.New("Client not present in the request context") )
var ErrIncorrectResponseType = errors.New("Response type not one of token or code")
ErrIncorrectResponseType a form value for response_type was not set to token or code
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service struct keeps variables for reuse
func NewService ¶
func NewService(cnf *config.Config, oauthService oauth.ServiceInterface, sessionService session.ServiceInterface) *Service
NewService returns a new Service instance
func (*Service) GetOauthService ¶
func (s *Service) GetOauthService() oauth.ServiceInterface
GetOauthService returns oauth.Service instance
func (*Service) GetSessionService ¶
func (s *Service) GetSessionService() session.ServiceInterface
GetSessionService returns session.Service instance
type ServiceInterface ¶
type ServiceInterface interface { // Exported methods GetConfig() *config.Config GetOauthService() oauth.ServiceInterface GetSessionService() session.ServiceInterface GetRoutes() []routes.Route RegisterRoutes(router *mux.Router, prefix string) Close() // contains filtered or unexported methods }
ServiceInterface defines exported methods
type StringBuilder ¶
type StringBuilder []string
func (*StringBuilder) AddTemplate ¶
func (sb *StringBuilder) AddTemplate(t *template.Template, name string, data interface{}) error
func (*StringBuilder) Append ¶
func (sb *StringBuilder) Append(s string)
func (*StringBuilder) Join ¶
func (sb *StringBuilder) Join(s *StringBuilder)
func (*StringBuilder) String ¶
func (sb *StringBuilder) String() string
type UpdateUserForm ¶
type UpdateUserForm struct { User *models.OauthUser NickName string `form:"nickname" validate:"omitempty,min=2"` FirstName string `form:"first_name" validate:"max=20"` LastName string `form:"last_name" validate:"max=20"` Password string `form:"password" validate:"omitempty,min=6"` AvatarURL string `form:"avatar_url"` Mobile string `form:"mobile" validate:"cnmobile"` Errors validator.ValidationErrors // contains filtered or unexported fields }
func (*UpdateUserForm) AddError ¶
func (f *UpdateUserForm) AddError(name, msg string)
func (*UpdateUserForm) Diff ¶
func (f *UpdateUserForm) Diff() map[string]interface{}
func (*UpdateUserForm) Error ¶
func (f *UpdateUserForm) Error(name string) validator.FieldError
func (*UpdateUserForm) ErrorMsg ¶
func (f *UpdateUserForm) ErrorMsg(name string) string
func (*UpdateUserForm) ErrorStatus ¶
func (f *UpdateUserForm) ErrorStatus(name string) string
func (*UpdateUserForm) ErrorText ¶
func (f *UpdateUserForm) ErrorText(name string) string
func (*UpdateUserForm) Valid ¶
func (f *UpdateUserForm) Valid() bool