profile

package
v0.0.0-...-8ba40cc Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Response

type Response struct {
	Profile app.Profile `json:"profile"`
}

type Server

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

func NewHTTP

func NewHTTP(store Store, secret []byte) (*Server, error)

func (*Server) HandleFollow

func (s *Server) HandleFollow(w http.ResponseWriter, r *http.Request) error

func (*Server) HandleGet

func (s *Server) HandleGet(w http.ResponseWriter, r *http.Request) error

func (*Server) HandleUnfollow

func (s *Server) HandleUnfollow(w http.ResponseWriter, r *http.Request) error

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.handler interface and uses router ServeHTTP method

type Service

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

func NewService

func NewService(store Store) *Service

func (*Service) Follow

func (s *Service) Follow(follower *app.User, username string) (*app.Profile, error)

func (*Service) Get

func (s *Service) Get(username string, currentUser *app.User) (*app.Profile, error)

func (*Service) Unfollow

func (s *Service) Unfollow(follower *app.User, username string) (*app.Profile, error)

type Store

type Store interface {
	GetProfile(username string, follower *app.Profile) (*app.Profile, error)
	FollowProfile(follower, followee *app.Profile) error
	UnfollowProfile(follower, followee *app.Profile) error
}

Jump to

Keyboard shortcuts

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