Documentation ¶
Index ¶
- type AuthorizedServer
- type AuthorizerServer
- type LoginServer
- type Opts
- type PostServer
- func (s *PostServer) CreatePost(ctx context.Context, post foodtinder.Post) (foodtinder.ID, error)
- func (s *PostServer) DeletePost(ctx context.Context, id foodtinder.ID) error
- func (s *PostServer) LikePost(ctx context.Context, id foodtinder.ID, like bool) error
- func (s *PostServer) LikedPosts(ctx context.Context) ([]foodtinder.Post, error)
- func (s *PostServer) NextPosts(ctx context.Context, previousID foodtinder.ID) ([]foodtinder.PostListing, error)
- func (s *PostServer) Post(ctx context.Context, id foodtinder.ID) (*foodtinder.PostListing, error)
- type Server
- type UserServer
- func (s *UserServer) ChangePassword(ctx context.Context, newPassword string) error
- func (s *UserServer) Self(ctx context.Context) (*foodtinder.Self, error)
- func (s *UserServer) UpdateSelf(ctx context.Context, new *foodtinder.Self) error
- func (s *UserServer) User(ctx context.Context, username string) (*foodtinder.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthorizedServer ¶
type AuthorizedServer struct { *Server // contains filtered or unexported fields }
func (*AuthorizedServer) Logout ¶
func (s *AuthorizedServer) Logout(ctx context.Context) error
Logout invalidates the authorizing token.
func (*AuthorizedServer) PostServer ¶
func (s *AuthorizedServer) PostServer() foodtinder.PostServer
func (*AuthorizedServer) Session ¶
func (s *AuthorizedServer) Session() *foodtinder.Session
func (*AuthorizedServer) UserServer ¶
func (s *AuthorizedServer) UserServer() foodtinder.UserServer
type AuthorizerServer ¶
type AuthorizerServer Server
func (*AuthorizerServer) Authorize ¶
func (s *AuthorizerServer) Authorize(ctx context.Context, token string) (*foodtinder.Session, error)
type LoginServer ¶
type LoginServer Server
func (*LoginServer) Login ¶
func (l *LoginServer) Login(ctx context.Context, username, password string, m foodtinder.LoginMetadata) (*foodtinder.Session, error)
func (*LoginServer) Register ¶
func (l *LoginServer) Register(ctx context.Context, username, password string, m foodtinder.LoginMetadata) (*foodtinder.Session, error)
type Opts ¶
type Opts struct { // SnowflakeNode is the node number to use for snowflake generation. Default // 0. SnowflakeNode int64 }
type PostServer ¶
type PostServer AuthorizedServer
func (*PostServer) CreatePost ¶
func (s *PostServer) CreatePost(ctx context.Context, post foodtinder.Post) (foodtinder.ID, error)
func (*PostServer) DeletePost ¶
func (s *PostServer) DeletePost(ctx context.Context, id foodtinder.ID) error
func (*PostServer) LikePost ¶
func (s *PostServer) LikePost(ctx context.Context, id foodtinder.ID, like bool) error
func (*PostServer) LikedPosts ¶
func (s *PostServer) LikedPosts(ctx context.Context) ([]foodtinder.Post, error)
func (*PostServer) NextPosts ¶
func (s *PostServer) NextPosts(ctx context.Context, previousID foodtinder.ID) ([]foodtinder.PostListing, error)
func (*PostServer) Post ¶
func (s *PostServer) Post(ctx context.Context, id foodtinder.ID) (*foodtinder.PostListing, error)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements a PostgreSQL driver.
func New ¶
func New(url *url.URL, fserver foodtinder.FileServer) (*Server, error)
New creates a new PostgreSQL server backend.
func (*Server) AuthorizedServer ¶
func (s *Server) AuthorizedServer(session *foodtinder.Session) foodtinder.AuthorizedServer
func (*Server) AuthorizerServer ¶
func (s *Server) AuthorizerServer() foodtinder.AuthorizerServer
func (*Server) FileServer ¶
func (s *Server) FileServer() foodtinder.FileServer
func (*Server) LoginServer ¶
func (s *Server) LoginServer() foodtinder.LoginServer
type UserServer ¶
type UserServer AuthorizedServer
func (*UserServer) ChangePassword ¶
func (s *UserServer) ChangePassword(ctx context.Context, newPassword string) error
func (*UserServer) Self ¶
func (s *UserServer) Self(ctx context.Context) (*foodtinder.Self, error)
func (*UserServer) UpdateSelf ¶
func (s *UserServer) UpdateSelf(ctx context.Context, new *foodtinder.Self) error
func (*UserServer) User ¶
func (s *UserServer) User(ctx context.Context, username string) (*foodtinder.User, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.