profile

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrExistingSocialLink = errors.New("existing social link")
View Source
var ErrInvalidDisplayName = errors.New("invalid display name")
View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type Server

type Server struct {
	profilepb.UnimplementedProfileServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(log *zap.Logger, accounts account.Store, profiles Store, xClient *x.Client, events event.ProfileGenerator, authz auth.Authorizer) *Server

func (*Server) GetProfile

func (*Server) UnlinkSocialAccount added in v1.3.0

type Store

type Store interface {
	// GetProfile returns the user profile for a user, or ErrNotFound.
	GetProfile(ctx context.Context, id *commonpb.UserId) (*profilepb.UserProfile, error)

	// SetDisplayName sets the display name for a user, provided they exist.
	//
	// ErrInvalidDisplayName is returned if there is an issue with the display name.
	SetDisplayName(ctx context.Context, id *commonpb.UserId, displayName string) error

	// LinkXAccount links a X account to a user ID
	LinkXAccount(ctx context.Context, userID *commonpb.UserId, xProfile *profilepb.XProfile, accessToken string) error

	// UnlinkXAccount removes the link to the X account
	UnlinkXAccount(ctx context.Context, userID *commonpb.UserId, xUserID string) error

	// GetXProfile gets a user's X profile if it has been linked
	GetXProfile(ctx context.Context, userID *commonpb.UserId) (*profilepb.XProfile, error)

	// GetUserLinkedToXAccount gets the user linked to X account
	GetUserLinkedToXAccount(ctx context.Context, xUserID string) (*commonpb.UserId, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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