profile

package
v0.0.0-...-789275d Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2017 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// UniqueIndex defines the unique index name used by the models db for model query optimization.
	UniqueIndex = "user_id"

	// UniqueIndexField defines the unique index field used by the model in it's field.
	UniqueIndexField = "user_public_id"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NewProfile

type NewProfile struct {
	Address   string `json:"address"`
	UserID    string `json:"user_id"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
}

NewProfile defines a struct which contains data for creating a new user profile.

type Profile

type Profile struct {
	Address   string `json:"address"`
	UserID    string `json:"user_id"`
	PublicID  string `json:"public_id"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
}

Profile defines a struct which holds the the details of a giving user's profile.

func New

func New(userID string) *Profile

New returns a new Profile instance using the supplied userid.

func (*Profile) Fields

func (u *Profile) Fields() map[string]interface{}

Fields returns a map representing the data of the session.

func (Profile) Table

func (Profile) Table() string

Table returns the given table which the given struct corresponds to.

func (*Profile) WithFields

func (u *Profile) WithFields(fields map[string]interface{}) error

WithFields attempts to syncing the giving data within the provided map into it's own fields.

type UpdateProfile

type UpdateProfile struct {
	Address   string `json:"address"`
	PublicID  string `json:"public_id"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
}

UpdateProfile defines a struct which contains data for updating user profile.

func (UpdateProfile) Fields

func (u UpdateProfile) Fields() map[string]interface{}

Fields returns a map representing the data of the session.

func (UpdateProfile) Table

func (UpdateProfile) Table() string

Table returns the given table which the given struct corresponds to.

Jump to

Keyboard shortcuts

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