Documentation
¶
Index ¶
- Constants
- Variables
- func NullableToInt(i nulls.Int) *int
- func NullableToString(s nulls.String) *string
- type File
- func (f *File) Create(tx *pop.Connection, userID uuid.UUID) (*validate.Errors, error)
- func (f File) String() string
- func (f *File) Validate(tx *pop.Connection) (*validate.Errors, error)
- func (f *File) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)
- func (f *File) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)
- type Files
- type Instruction
- func (i *Instruction) Create(tx *pop.Connection, w Will) (*validate.Errors, error)
- func (i Instruction) String() string
- func (i Instruction) ToGraphQL() *model.Instruction
- func (i *Instruction) Validate(tx *pop.Connection) (*validate.Errors, error)
- func (i *Instruction) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)
- func (i *Instruction) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)
- type Instructions
- type Session
- func (s *Session) Create(tx *pop.Connection, u *User, protected bool) error
- func (s *Session) ResetUniqueToken(tx *pop.Connection) error
- func (s Session) String() string
- func (s *Session) TableName() string
- func (s *Session) Validate(tx *pop.Connection) (*validate.Errors, error)
- func (s *Session) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)
- func (s *Session) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)
- type Sessions
- type Trustee
- func (t *Trustee) Create(tx *pop.Connection, userID uuid.UUID) (*validate.Errors, error)
- func (t Trustee) String() string
- func (t Trustee) ToGraphQL() *model.Trustee
- func (t *Trustee) Update(tx *pop.Connection) (*validate.Errors, error)
- func (t *Trustee) Validate(tx *pop.Connection) (*validate.Errors, error)
- func (t *Trustee) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)
- func (t *Trustee) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)
- type Trustees
- type User
- func (u *User) Create(tx *pop.Connection) (*validate.Errors, error)
- func (u User) String() string
- func (u User) TableName() string
- func (u *User) Validate(tx *pop.Connection) (*validate.Errors, error)
- func (u *User) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)
- func (u *User) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)
- type UserConfirmation
- func (u *UserConfirmation) CheckKeysMatch(keys string) (bool, error)
- func (u *UserConfirmation) Confirm(tx *pop.Connection) error
- func (u *UserConfirmation) Create(tx *pop.Connection, user *User) error
- func (u *UserConfirmation) SendKeys(tx *pop.Connection) error
- func (u *UserConfirmation) SetSeen(tx *pop.Connection) error
- func (u UserConfirmation) String() string
- func (u *UserConfirmation) Validate(tx *pop.Connection) (*validate.Errors, error)
- func (u *UserConfirmation) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)
- func (u *UserConfirmation) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)
- type UserConfirmations
- type Users
- type Will
- func (w *Will) Create(tx *pop.Connection, u *User) (*validate.Errors, error)
- func (w *Will) Get(tx *pop.Connection, id uuid.UUID) error
- func (w Will) String() string
- func (w Will) ToGraphQL() *model.Will
- func (w *Will) Validate(tx *pop.Connection) (*validate.Errors, error)
- func (w *Will) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)
- func (w *Will) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)
- type Wills
Constants ¶
const KEYS_NUMBER = 5
const MAX_FILESIZE = 1000000000 //in bytes = 1 GB
Variables ¶
var ACCEPTABLE_FILETYPES = map[string][]string{
"image": {
"png",
"jpg",
"jp2",
"jpeg",
"gif",
"bmp",
"wbmp",
"pgm",
},
"video": {
"webm",
"mkv",
"flv",
"vob",
"ogv",
"ogg",
"gifv",
"avi",
"mng",
"mov",
"wmv",
"mp4",
"m4p",
"m4v",
"mpg",
"mp2",
"mpeg",
"mpe",
"mpv",
"m2v",
"m4v",
},
"audio": {
"3gp",
"aa",
"aac",
"aiff",
"dvf",
"flac",
"gsm",
"m4a",
"m4b",
"m4p",
"mmf",
"mp3",
"ogg",
"oga",
"mogg",
"raw",
"tta",
"voc",
"vox",
"wav",
"wma",
"wv",
"webm",
},
}
var DB *pop.Connection
DB is a connection to your database to be used throughout your application.
var TRUSTEE_RELATIONSHIP_TYPES = []string{
"father",
"mother",
"other_relative",
"best_friend",
"school_friend",
"college_friend",
"other_friend",
"husband",
"wife",
"girlfriend",
"boyfriend",
"fiance",
"acquaintance",
}
Functions ¶
func NullableToInt ¶
func NullableToString ¶
Types ¶
type File ¶
type File struct { ID uuid.UUID `json:"id" db:"id"` CreatedAt time.Time `json:"created_at" db:"created_at"` UpdatedAt time.Time `json:"updated_at" db:"updated_at"` OwnerID uuid.UUID `json:"owner_id" db:"owner_id"` Url string `json:"url" db:"url"` Filename string `json:"filename" db:"filename"` Path string `json:"path" db:"path"` Type string `json:"type" db:"type"` FileSize int64 `json:"file_size" db:"file_size"` }
func (*File) Validate ¶
Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.
func (*File) ValidateCreate ¶
ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.
func (*File) ValidateUpdate ¶
ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.
type Instruction ¶
type Instruction struct { ID uuid.UUID `json:"id" db:"id"` CreatedAt time.Time `json:"created_at" db:"created_at"` UpdatedAt time.Time `json:"updated_at" db:"updated_at"` Index uint `json:"index" db:"index"` Text string `json:"text" db:"content"` Picture *File `json:"picture" db:"-"` Audio *File `json:"audio" db:"-"` Video *File `json:"video" db:"-"` WillID uuid.UUID `json:"will_id" db:"will_id"` }
func (*Instruction) Create ¶
func (i *Instruction) Create(tx *pop.Connection, w Will) (*validate.Errors, error)
Creates instruction entry in the DB
func (Instruction) String ¶
func (i Instruction) String() string
String is not required by pop and may be deleted
func (Instruction) ToGraphQL ¶
func (i Instruction) ToGraphQL() *model.Instruction
func (*Instruction) Validate ¶
func (i *Instruction) Validate(tx *pop.Connection) (*validate.Errors, error)
Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.
func (*Instruction) ValidateCreate ¶
func (i *Instruction) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)
ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.
func (*Instruction) ValidateUpdate ¶
func (i *Instruction) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)
ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.
type Instructions ¶
type Instructions []Instruction
Instructions is not required by pop and may be deleted
func (*Instructions) Create ¶
func (is *Instructions) Create(tx *pop.Connection, w Will) (*validate.Errors, error)
func (Instructions) String ¶
func (i Instructions) String() string
String is not required by pop and may be deleted
func (Instructions) ToGraphQL ¶
func (is Instructions) ToGraphQL() []*model.Instruction
type Session ¶
type Session struct { ID uuid.UUID `json:"id" db:"id"` CreatedAt time.Time `json:"created_at" db:"created_at"` UpdatedAt time.Time `json:"updated_at" db:"updated_at"` UserID uuid.UUID `json:"user_id" db:"user_id"` UniqueToken nulls.String `json:"unique_token" db:"unique_token"` //used only in registration/login RefreshToken string `json:"refresh_token" db:"-"` RefreshTokenHash []byte `json:"-" db:"refresh_token"` }
func (*Session) ResetUniqueToken ¶
func (s *Session) ResetUniqueToken(tx *pop.Connection) error
func (*Session) Validate ¶
Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.
func (*Session) ValidateCreate ¶
ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.
func (*Session) ValidateUpdate ¶
ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.
type Trustee ¶
type Trustee struct { ID uuid.UUID `json:"id" db:"id"` CreatedAt time.Time `json:"created_at" db:"created_at"` UpdatedAt time.Time `json:"updated_at" db:"updated_at"` UserID uuid.UUID `json:"user_id" db:"user_id"` Name string `json:"name" db:"name"` Relationship string `json:"relationship" db:"relationship"` Phone string `json:"phone" db:"phone"` Email string `json:"email" db:"email"` FacebookLink nulls.String `json:"facebook_link" db:"facebook_link"` TwitterLink nulls.String `json:"twitter_link" db:"twitter_link"` AdditionalInfo nulls.String `json:"additional_info" db:"additional_information"` }
func (*Trustee) Validate ¶
Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.
func (*Trustee) ValidateCreate ¶
ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.
func (*Trustee) ValidateUpdate ¶
ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.
type Trustees ¶
type Trustees []Trustee
Trustees is not required by pop and may be deleted
func (*Trustees) GetForUser ¶
type User ¶
type User struct { ID uuid.UUID `json:"id" db:"id"` ProviderID string `json:"-" db:"provider_id"` Provider string `json:"provider" db:"provider"` Name string `json:"name" db:"username"` CreatedAt time.Time `json:"created_at" db:"created_at"` UpdatedAt time.Time `json:"updated_at" db:"updated_at"` }
func (*User) Validate ¶
Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.
func (*User) ValidateCreate ¶
ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.
func (*User) ValidateUpdate ¶
ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.
type UserConfirmation ¶
type UserConfirmation struct { ID uuid.UUID `json:"id" db:"id"` UserID uuid.UUID `json:"user_id" db:"user_id"` Keys string `json:"-" db:"-"` KeysEncrypted []byte `json:"-" db:"keys"` KeysSent bool `json:"keys_sent" db:"keys_sent"` KeysSeenConfirmation bool `json:"keys_seen_confirmation" db:"keys_seen"` Confirmed bool `json:"confirmed" db:"confirmed"` CreatedAt time.Time `json:"created_at" db:"created_at"` UpdatedAt time.Time `json:"updated_at" db:"updated_at"` }
func (*UserConfirmation) CheckKeysMatch ¶
func (u *UserConfirmation) CheckKeysMatch(keys string) (bool, error)
func (*UserConfirmation) Confirm ¶
func (u *UserConfirmation) Confirm(tx *pop.Connection) error
func (*UserConfirmation) Create ¶
func (u *UserConfirmation) Create(tx *pop.Connection, user *User) error
func (*UserConfirmation) SendKeys ¶
func (u *UserConfirmation) SendKeys(tx *pop.Connection) error
func (*UserConfirmation) SetSeen ¶
func (u *UserConfirmation) SetSeen(tx *pop.Connection) error
func (UserConfirmation) String ¶
func (u UserConfirmation) String() string
String is not required by pop and may be deleted
func (*UserConfirmation) Validate ¶
func (u *UserConfirmation) Validate(tx *pop.Connection) (*validate.Errors, error)
Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.
func (*UserConfirmation) ValidateCreate ¶
func (u *UserConfirmation) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)
ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.
func (*UserConfirmation) ValidateUpdate ¶
func (u *UserConfirmation) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)
ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.
type UserConfirmations ¶
type UserConfirmations []UserConfirmation
UserConfirmations is not required by pop and may be deleted
func (UserConfirmations) String ¶
func (u UserConfirmations) String() string
String is not required by pop and may be deleted
type Will ¶
type Will struct { ID uuid.UUID `json:"id" db:"id"` CreatedAt time.Time `json:"created_at" db:"created_at"` UpdatedAt time.Time `json:"updated_at" db:"updated_at"` Title string `json:"title" db:"title"` Priority nulls.UInt32 `json:"importance" db:"priority"` Instructions *Instructions `json:"instructions" db:"-" has_many:"instructions"` Pictures *File `json:"pictures" db:"-"` Videos *File `json:"videos" db:"-"` Audios *File `json:"audios" db:"-"` UserID uuid.UUID `json:"user_id" db:"user_id"` Trustees *Trustees `json:"trustees" db:"-"` }
func (*Will) Validate ¶
Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.
func (*Will) ValidateCreate ¶
ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.
func (*Will) ValidateUpdate ¶
ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.