domain

package
v0.0.0-...-40fc3ee Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Image

type Image struct {
	Name   string `json:"name" bson:"name,omitempty"`
	Type   string `json:"type" bson:"type,omitempty"`
	Size   int64  `json:"size" bson:"size,omitempty"`
	Width  int    `json:"width" bson:"width,omitempty"`
	Height int    `json:"height" bson:"height,omitempty"`
}

Image ...

type Profile

type Profile struct {
	ID              bson.ObjectId   `json:"id" bson:"_id,omitempty"`
	UserName        string          `json:"username" bson:"username,omitempty"`
	Level           string          `json:"level" bson:"level,omitempty"`
	Rings           int32           `json:"rings" bson:"rings,omitempty"`
	About           string          `json:"about" bson:"about,omitempty"`
	ProfileImage    Image           `json:"profileImage" bson:"profile_image,omitempty"`
	BackgroundImage Image           `json:"backgroundImage" bson:"background_image,omitempty"`
	Followers       []bson.ObjectId `json:"followers" bson:"followers,omitempty"`
	Following       []bson.ObjectId `json:"following" bson:"following,omitempty"`
	DateLastUpdated time.Time       `json:"dateLastUpdated" bson:"date_last_updated,omitempty"`
}

Profile ...

func NewProfile

func NewProfile(username, level, about string, followers []string, following []string, rings int32) *Profile

NewProfile creates a new Profile!

func ProfileFromContext

func ProfileFromContext(ctx context.Context) (*Profile, bool)

ProfileFromContext gets profile from context

func ProfileMustFromContext

func ProfileMustFromContext(ctx context.Context) *Profile

ProfileMustFromContext gets profile from context. if can't make panic

func (*Profile) NewContext

func (u *Profile) NewContext(ctx context.Context) context.Context

NewContext ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL