Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessToken ¶
type Article ¶
type Article struct { Id bson.ObjectId `json:"id" bson:"_id"` Title string `valid:"required" json:"title" bson:"title"` Content string `valid:"required" json:"content" bson:"content"` UserId bson.ObjectId `json:"user_id" bson:"user_id"` CreatedAt time.Time `json:"created_at" bson:"created_at"` UpdatedAt time.Time `json:"updated_at" bson:"updated_at"` }
type AuthenticationResponse ¶
type AuthenticationResponse struct { TokenType string `json:"token_type"` AccessToken string `json:"access_token"` ExpiresInMin float64 `json:"expire_in_min"` RefreshToken string `json:"refresh_token"` }
it's used only for JSON response in authentication and refresh token requests
type Client ¶
type Client struct { AppId bson.ObjectId `json:"app_id" bson:"_id"` AppKey string `json:"app_key" bson:"key"` Name string `valid:"required" json:"name" bson:"name"` Description string `json:"description,omitempty" bson:"description,omitempty"` IsEnable bool `default:"true" json:"is_enable" bson:"enable_status"` PlatformType string `default:"web" json:"platform_type" bson:"platform_type"` CreatedAt time.Time `json:"created_at" bson:"created_at"` UpdatedAt time.Time `json:"updated_at" bson:"updated_at"` }
func (*Client) HashedAppKey ¶
type RefreshTokenRequest ¶
type RefreshTokenRequest struct { AppId string `valid:"required" json:"app_id"` AppKey string `json:"app_key"` RefreshToken string `valid:"required" json:"refresh_token"` }
it's used only for JSON request
type SignInRequest ¶
type SignInRequest struct { AppId string `valid:"required" json:"app_id"` AppKey string `json:"app_key"` DeviceModel string `json:"device_model"` Email string `valid:"email,required" json:"email"` Password string `valid:"length(6|64),required" json:"password"` }
it's used only for JSON request
type SignUpRequest ¶
type SignUpRequest struct { AppId string `valid:"required" json:"app_id"` AppKey string `json:"app_key"` DeviceModel string `json:"device_model"` FirstName string `valid:"required" json:"first_name" bson:"first_name"` LastName string `valid:"required" json:"last_name" bson:"last_name"` DisplayName string `valid:"required" json:"display_name" bson:"display_name"` Email string `valid:"email,required" json:"email"` Password string `valid:"length(6|64),required" json:"password"` }
it's used only for JSON request
type TrustedApp ¶
type TrustedApp struct { Id bson.ObjectId `bson:"_id"` ClientId bson.ObjectId `bson:"_client"` RefreshToken string `bson:"refresh_token"` DeviceModel string `bson:"device_model,omitempty"` OSVersion string `bson:"os_version,omitempty"` AppVersion string `bson:"app_version,omitempty"` MessageTokenType string `bson:"message_token_type,omitempty"` MessageToken string `bson:"message_token,omitempty"` GrantedAt time.Time `bson:"granted_at"` }
only for database models
type User ¶
type User struct { Id bson.ObjectId `json:"id" bson:"_id"` FirstName string `valid:"required" json:"first_name" bson:"first_name"` LastName string `valid:"required" json:"last_name" bson:"last_name"` DisplayName string `valid:"required" json:"display_name" bson:"display_name"` Email string `valid:"email,required" json:"email" bson:"email"` HashedPassword string `json:"password,omitempty" bson:"hashed_password"` ImageFileName string `default:"default_image_profile.jpeg" json:"image_profile_url" bson:"image_profile_file_name"` IsEnable bool `default:"true" json:"is_enable" bson:"enable_status"` TrustedApps []TrustedApp `json:"-" bson:"trusted_apps,omitempty"` Roles []string `json:"roles" bson:"roles"` JoinedAt time.Time `json:"joined_at" bson:"joined_at"` UpdatedAt time.Time `json:"updated_at" bson:"updated_at"` }
used for database and JSON
Click to show internal directories.
Click to hide internal directories.