profiles

package
v0.0.0-...-a84335b Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package profiles provides access to user profiles and their associated methods

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InviteParams

type InviteParams struct {
	Email    string
	Message  string
	LoginURL string
}

type Profile

type Profile struct {
	ID            string
	Email         string
	Name          string
	Bio           string
	InvitedBy     string
	InvitedByName string
	Created       time.Time
}

Profile represents a user profile

type Profiles

type Profiles struct {
	// contains filtered or unexported fields
}

func New

func New(db profiledb, eml emlSrv) Profiles

func (Profiles) Create

func (p Profiles) Create(ctx context.Context, email, invitedBy string) (Profile, error)

Create makes a new Profile in the database and returns the result

func (Profiles) Get

func (s Profiles) Get(ctx context.Context, id string) (Profile, error)

Get returns a Profile by the given ID

func (Profiles) Invite

func (s Profiles) Invite(ctx context.Context, p Profile, params InviteParams) error

Invite creates a provisional profile entry and sends an invite code to the given email address.

func (Profiles) List

func (s Profiles) List(ctx context.Context) ([]Profile, error)

List returns all Profiles

func (Profiles) ListFriends

func (s Profiles) ListFriends(ctx context.Context, profileID string) ([]Profile, error)

ListFriends returns all complete and active profiles accessible by requester

func (Profiles) Update

func (s Profiles) Update(ctx context.Context, p Profile, params UpdateProfileParams) (Profile, error)

Update will modify a Profile with the given non-nil parameters. It will then return the updated profile.

type UpdateProfileParams

type UpdateProfileParams struct {
	Email *string
	Name  *string
	Bio   *string
}

UpdateProfileParams receives optional fields for updating a profile

Jump to

Keyboard shortcuts

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