Documentation ¶
Index ¶
- Constants
- type App
- func (a *App) ExistsInProfiles(parentCtx context.Context, ID primitive.ObjectID) (bool, error)
- func (a *App) HavePublicDevices(parentCtx context.Context, prn string) (bool, error)
- func (a *App) MakeUserProfile(parentCtx context.Context, account *accounts.Account, ...) (*Profile, error)
- func (a *App) MarkProfileAsPrivate(parentCtx context.Context, prn string) error
- type ModelError
- type Profile
- type UpdateableProfile
Constants ¶
View Source
const CollectionName = "pantahub_profiles"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
App define a new rest application for profiles
func New ¶
func New(jwtMiddleware *jwt.JWTMiddleware, mongoClient *mongo.Client) *App
New create a profiles rest application
func (*App) ExistsInProfiles ¶
ExistsInProfiles : Check if a user details exists in profiles or not
func (*App) HavePublicDevices ¶
HavePublicDevices : Check if a user have public devices or not
func (*App) MakeUserProfile ¶
func (a *App) MakeUserProfile(parentCtx context.Context, account *accounts.Account, newProfile *UpdateableProfile) (*Profile, error)
MakeUserProfile : Make User Profile from account
type ModelError ¶
ModelError error type
type Profile ¶
type Profile struct { ID primitive.ObjectID `json:"-" bson:"_id"` Prn string `json:"-" bson:"prn"` Nick string `json:"nick" bson:"-"` Email string `json:"email" bson:"-"` *UpdateableProfile `json:",inline" bson:",inline"` Meta map[string]interface{} `json:"meta" bson:"meta"` Public bool `json:"-" bson:"public"` Garbage bool `json:"-" bson:"garbage"` TimeCreated time.Time `json:"time-created,omitempty" bson:"time-created"` TimeModified time.Time `json:"time-modified,omitempty" bson:"time-modified"` }
Profile : Public information for one account
type UpdateableProfile ¶
type UpdateableProfile struct { FullName string `json:"fullName" bson:"full-name"` Bio string `json:"bio" bson:"bio"` Picture string `json:"picture" bson:"picture"` Website string `json:"website" bson:"website"` Location string `json:"location" bson:"location"` Github string `json:"github" bson:"github"` Gitlab string `json:"gitlab" bson:"gitlab"` Company string `json:"company" bson:"company"` Twitter string `json:"twitter" bson:"twitter"` }
UpdateableProfile updateable part of a Profile
Click to show internal directories.
Click to hide internal directories.