v1

package
v0.0.0-...-e7cb044 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateTweetsOptions

func GenerateTweetsOptions(vls v1.TweetsURLValues) storage.TweetsOptions

func ValidateTweetsURLValues

func ValidateTweetsURLValues(vls v1.TweetsURLValues) error

ValidateTweetsURLValues validates the tweets URL values.

Types

type Server

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

Server represents a web server.

func NewServer

func NewServer(db storage.Twitter, config http.Config, logger *zap.Logger) *Server

NewServer returns a server.

func (*Server) ListTweets

func (srv *Server) ListTweets(w http.ResponseWriter, r *http.Request)

ListTweets handles the tweets endpoint. @Summary User tweets @Description Get all the tweets of a twitter user or the tweets in a specific time span. @Tags Tweets @ID list-tweets @Produce json @Param user path string true "User" @Param before_time query string false "tweets before specific date" @Param after_time query string false "tweets after specific date" @Success 200 {object} v1.TweetsResponse @Failure 400 {object} v1.ErrorResponse @Failure 404 {object} v1.ErrorResponse @Failure 500 {object} v1.ErrorResponse @Router /tweets/v1/user/{user} [get]

func (*Server) Start

func (srv *Server) Start(ctx context.Context)

Jump to

Keyboard shortcuts

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