postgres

package
v0.0.0-...-381a539 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

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

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) Close

func (s *Server) Close() error

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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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