http

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ApiKey = "AIzaSyBVJgyC-x6CsM-hPCYY10VfOnGOKksDK8U"

Variables

This section is empty.

Functions

func Setup

func Setup(h *Handler, port int)

Types

type ApiSearchResponse

type ApiSearchResponse struct {
	Items []struct {
		ID struct {
			VideoID string `json:"videoId"`
		} `json:"id"`
		Snippet struct {
			PublishedAt time.Time `json:"publishedAt"`
			Title       string    `json:"title"`
			Description string    `json:"description"`
			Thumbnails  struct {
				High struct {
					URL string `json:"url"`
				} `json:"high"`
			} `json:"thumbnails"`
		} `json:"snippet"`
	} `json:"items"`
}

type AuthRequest

type AuthRequest struct {
	SessionID string `json:"session_id"`
}

type Handler

type Handler struct {
	UserService      player.UserService
	UserSession      player.UserSession
	VideoListService player.VideoListService
	VideoService     player.VideoService
}

func (*Handler) AuthMiddleware

func (h *Handler) AuthMiddleware(next http.Handler) http.Handler

type LoginRequest

type LoginRequest struct {
	User struct {
		Login    string `json:"login"`
		Password string `json:"password"`
	} `json:"user"`
}

type LoginResponse

type LoginResponse struct {
	User struct {
		ID        int64  `json:"id"`
		Login     string `json:"login"`
		SessionID string `json:"session_id"`
		Likes     []struct {
			VideoID int64 `json:"video_id"`
		} `json:"likes"`
	} `json:"user"`
}

type SearchResponse

type SearchResponse []struct {
	ID          string    `json:"id"`
	Title       string    `json:"title"`
	Description string    `json:"description"`
	PubDate     time.Time `json:"pub_date"`
	Thumbnail   string    `json:"thumbnail"`
	Liked       bool      `json:"liked"`
}

type VideoFinder

type VideoFinder struct{}

func (*VideoFinder) Search

func (s *VideoFinder) Search(query string) (*player.VideoList, error)

Jump to

Keyboard shortcuts

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