twirp

package
v0.0.0-...-b2fa3f8 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminService

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

func NewAdminService

func NewAdminService(podCon *podcast.PodController, rssCon *podcast.RSSController) *AdminService

func (*AdminService) AddPodcast

func (a *AdminService) AddPodcast(ctx context.Context, req *protos.AddPodReq) (*protos.AddPodRes, error)

Podcasts

func (*AdminService) RefreshPodcast

func (a *AdminService) RefreshPodcast(ctx context.Context, req *protos.RefPodReq) (*protos.RefPodRes, error)

type AuthService

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

AuthService is the twirp service for authentication and authorization

func NewAuthService

func NewAuthService(a *auth.AuthController) *AuthService

NewAuthService creates a new *AuthService

func (*AuthService) Authenticate

Authenticate handles the authentication to syncapod and returns response

func (*AuthService) Logout

func (a *AuthService) Logout(ctx context.Context, req *protos.LogoutReq) (*protos.LogoutRes, error)

Logout removes the given session key from the db, in effect "logging out" of the user's session

type PodcastService

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

PodcastService is the gRPC service for podcast

func NewPodcastService

func NewPodcastService(podCon *podcast.PodController) *PodcastService

NewPodcastService creates a new *PodcastService

func (*PodcastService) GetEpisodes

func (p *PodcastService) GetEpisodes(ctx context.Context, req *protos.GetEpiReq) (*protos.Episodes, error)

GetEpisodes returns a list of episodes via podcast id

func (*PodcastService) GetPodcast

func (p *PodcastService) GetPodcast(ctx context.Context, req *protos.GetPodReq) (*protos.Podcast, error)

GetPodcast returns a podcast via id

func (*PodcastService) GetSubscriptions

func (p *PodcastService) GetSubscriptions(ctx context.Context, req *protos.GetSubReq) (*protos.Subscriptions, error)

GetSubscriptions returns a list of podcasts via user id

func (*PodcastService) GetUserEpisode

func (p *PodcastService) GetUserEpisode(ctx context.Context, req *protos.GetUserEpiReq) (*protos.UserEpisode, error)

GetUserEpisode returns the user playback metadata via episode id & user id

func (*PodcastService) GetUserLastPlayed

func (p *PodcastService) GetUserLastPlayed(ctx context.Context, req *protos.GetUserLastPlayedReq) (*protos.LastPlayedRes, error)

GetUserLastPlayed returns the last episode the user was playing & metadata

func (*PodcastService) UpsertUserEpisode

func (p *PodcastService) UpsertUserEpisode(ctx context.Context, userEpiReq *protos.UserEpisode) (*protos.Response, error)

UpsertUserEpisode updates the user playback metadata via episode id & user id

type Server

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

Server is truly needed for its Intercept method which authenticates users before accessing services, but also useful to have all the grpc server boilerplate contained within NewServer function

func NewServer

func NewServer(a *autocert.Manager, aC *auth.AuthController, aS protos.Auth, pS protos.Pod, adminS protos.Admin) *Server

func (*Server) Start

func (s *Server) Start() error

type TwirpService

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

Jump to

Keyboard shortcuts

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