http

package
v0.0.0-...-b28803a Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const ShutdownTimeout = 1 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type APIFunc

type APIFunc func(http.ResponseWriter, *http.Request) error

type APIServer

type APIServer struct {
	Domain string

	AuthService AuthService
	FeedService FeedService
	// contains filtered or unexported fields
}

func NewAPIServer

func NewAPIServer(db DB) *APIServer

func NewPostgresAPIServer

func NewPostgresAPIServer() *APIServer

func (*APIServer) Close

func (s *APIServer) Close() error

func (*APIServer) Open

func (s *APIServer) Open() (err error)

func (*APIServer) Port

func (s *APIServer) Port() int

func (*APIServer) Scheme

func (s *APIServer) Scheme() string

func (*APIServer) ServeHTTP

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

func (*APIServer) URL

func (s *APIServer) URL() string

type AuthService

type AuthService interface {
	SignUp(ctx context.Context, req *rf.SignUpRequest) (string, error)
	SignIn(ctx context.Context, req *rf.SignInRequest) (string, error)
}

type DB

type DB interface {
	Open() error
	Close() error
}

type FeedService

type FeedService interface {
	AddFeed(ctx context.Context, req *rf.AddFeedRequest) (int64, error)
	RemoveFeed(ctx context.Context, feedID int64) error
	GetFeeds(ctx context.Context) ([]rf.Feed, error)
	GetFeed(ctx context.Context, feedID int64) (*rf.Feed, error)
}

Jump to

Keyboard shortcuts

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