server

package
v0.0.0-...-4fdfd55 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToWaitlistEndpoint

func AddToWaitlistEndpoint(r rpc.RPC) protocol.MessageEndpoint

func AuthEndpoint

func AuthEndpoint(r rpc.RPC) protocol.MessageEndpoint

func BlockUserEndpoint

func BlockUserEndpoint(r rpc.RPC) protocol.MessageEndpoint

func CanAffordAnonymousPostEndpoint

func CanAffordAnonymousPostEndpoint(r rpc.RPC) protocol.MessageEndpoint

func ConfirmValidationEndpoint

func ConfirmValidationEndpoint(r rpc.RPC) protocol.MessageEndpoint

func ConnectUsersEndpoint

func ConnectUsersEndpoint(r rpc.RPC) protocol.MessageEndpoint

func CreateChannelEndpoint

func CreateChannelEndpoint(r rpc.RPC) protocol.MessageEndpoint

func DeleteCardEndpoint

func DeleteCardEndpoint(r rpc.RPC) protocol.MessageEndpoint

func FollowUserEndpoint

func FollowUserEndpoint(r rpc.RPC) protocol.MessageEndpoint

func GetActionCostsEndpoint

func GetActionCostsEndpoint(r rpc.RPC) protocol.MessageEndpoint

func GetAnonymousHandleEndpoint

func GetAnonymousHandleEndpoint(r rpc.RPC) protocol.MessageEndpoint

func GetCardEndpoint

func GetCardEndpoint(r rpc.RPC) protocol.MessageEndpoint

func GetCardsEndpoint

func GetCardsEndpoint(r rpc.RPC) protocol.MessageEndpoint

func GetCardsForChannelEndpoint

func GetCardsForChannelEndpoint(r rpc.RPC) protocol.MessageEndpoint

func GetChannelEndpoint

func GetChannelEndpoint(r rpc.RPC) protocol.MessageEndpoint

func GetChannelsEndpoint

func GetChannelsEndpoint(r rpc.RPC) protocol.MessageEndpoint

func GetFeaturesForUserEndpoint

func GetFeaturesForUserEndpoint(r rpc.RPC) protocol.MessageEndpoint

func GetFollowingUsersEndpoint

func GetFollowingUsersEndpoint(r rpc.RPC) protocol.MessageEndpoint

func GetInvitesEndpoint

func GetInvitesEndpoint(r rpc.RPC) protocol.MessageEndpoint

func GetLeaderboardEndpoint

func GetLeaderboardEndpoint(r rpc.RPC) protocol.MessageEndpoint

func GetMyNetworkEndpoint

func GetMyNetworkEndpoint(r rpc.RPC) protocol.MessageEndpoint

func GetNotificationsEndpoint

func GetNotificationsEndpoint(r rpc.RPC) protocol.MessageEndpoint

func GetOnboardingDataEndpoint

func GetOnboardingDataEndpoint(r rpc.RPC) protocol.MessageEndpoint

func GetPopularCardsEndpoint

func GetPopularCardsEndpoint(r rpc.RPC) protocol.MessageEndpoint

func GetPostsForUserEndpoint

func GetPostsForUserEndpoint(r rpc.RPC) protocol.MessageEndpoint

func GetTaggableUsersEndpoint

func GetTaggableUsersEndpoint(r rpc.RPC) protocol.MessageEndpoint

func GetTagsEndpoint

func GetTagsEndpoint(r rpc.RPC) protocol.MessageEndpoint

func GetThreadEndpoint

func GetThreadEndpoint(r rpc.RPC) protocol.MessageEndpoint

func GetUserEndpoint

func GetUserEndpoint(r rpc.RPC) protocol.MessageEndpoint

func GetUsersEndpoint

func GetUsersEndpoint(r rpc.RPC) protocol.MessageEndpoint

func GroupInvitesEndpoint

func GroupInvitesEndpoint(r rpc.RPC) protocol.MessageEndpoint

func JoinChannelEndpoint

func JoinChannelEndpoint(r rpc.RPC) protocol.MessageEndpoint

func LeaveChannelEndpoint

func LeaveChannelEndpoint(r rpc.RPC) protocol.MessageEndpoint

func LogoutEndpoint

func LogoutEndpoint(r rpc.RPC) protocol.MessageEndpoint

func ModifyCardScoreEndpoint

func ModifyCardScoreEndpoint(r rpc.RPC) protocol.MessageEndpoint

func MuteChannelEndpoint

func MuteChannelEndpoint(r rpc.RPC) protocol.MessageEndpoint

func MuteThreadEndpoint

func MuteThreadEndpoint(r rpc.RPC) protocol.MessageEndpoint

func MuteUserEndpoint

func MuteUserEndpoint(r rpc.RPC) protocol.MessageEndpoint

func NewInviteEndpoint

func NewInviteEndpoint(r rpc.RPC) protocol.MessageEndpoint

func NewUserEndpoint

func NewUserEndpoint(r rpc.RPC) protocol.MessageEndpoint

func PostCardEndpoint

func PostCardEndpoint(r rpc.RPC) protocol.MessageEndpoint

func PreviewContentEndpoint

func PreviewContentEndpoint(r rpc.RPC) protocol.MessageEndpoint

func RateLimit

func RateLimit(rt ratelimit.Limiter) protocol.Middleware

func ReactToCardEndpoint

func ReactToCardEndpoint(r rpc.RPC) protocol.MessageEndpoint

func RegisterDeviceEndpoint

func RegisterDeviceEndpoint(r rpc.RPC) protocol.MessageEndpoint

func ReportCardEndpoint

func ReportCardEndpoint(r rpc.RPC) protocol.MessageEndpoint

func RequestValidationEndpoint

func RequestValidationEndpoint(r rpc.RPC) protocol.MessageEndpoint

func RequireAdmin

func RequireAdmin(store *store.Store) protocol.Middleware

RequireAdmin is a middleware to ensure the request is authorized for admin-only actions.

func RequireUser

func RequireUser(store *store.Store) protocol.Middleware

RequireUser is a middleware for endpoints to ensure the request is authenticated.

func ResetPasswordEndpoint

func ResetPasswordEndpoint(r rpc.RPC) protocol.MessageEndpoint

func SubmitFeedbackEndpoint

func SubmitFeedbackEndpoint(r rpc.RPC) protocol.MessageEndpoint

func SubscribeToCardEndpoint

func SubscribeToCardEndpoint(r rpc.RPC) protocol.MessageEndpoint

func TipCardEndpoint

func TipCardEndpoint(r rpc.RPC) protocol.MessageEndpoint

func UnfollowUserEndpoint

func UnfollowUserEndpoint(r rpc.RPC) protocol.MessageEndpoint

func UnmuteChannelEndpoint

func UnmuteChannelEndpoint(r rpc.RPC) protocol.MessageEndpoint

func UnmuteThreadEndpoint

func UnmuteThreadEndpoint(r rpc.RPC) protocol.MessageEndpoint

func UnmuteUserEndpoint

func UnmuteUserEndpoint(r rpc.RPC) protocol.MessageEndpoint

func UnregisterDeviceEndpoint

func UnregisterDeviceEndpoint(r rpc.RPC) protocol.MessageEndpoint

func UnsubscribeFromCardEndpoint

func UnsubscribeFromCardEndpoint(r rpc.RPC) protocol.MessageEndpoint

func UpdateChannelSubscriptionEndpoint

func UpdateChannelSubscriptionEndpoint(r rpc.RPC) protocol.MessageEndpoint

func UpdateNotificationsEndpoint

func UpdateNotificationsEndpoint(r rpc.RPC) protocol.MessageEndpoint

func UpdateSettingsEndpoint

func UpdateSettingsEndpoint(r rpc.RPC) protocol.MessageEndpoint

func UploadImageEndpoint

func UploadImageEndpoint(r rpc.RPC) protocol.MessageEndpoint

func UseInviteCodeEndpoint

func UseInviteCodeEndpoint(r rpc.RPC) protocol.MessageEndpoint

func ValidateChannelNameEndpoint

func ValidateChannelNameEndpoint(r rpc.RPC) protocol.MessageEndpoint

func ValidateInviteCodeEndpoint

func ValidateInviteCodeEndpoint(r rpc.RPC) protocol.MessageEndpoint

func ValidateUsernameEndpoint

func ValidateUsernameEndpoint(r rpc.RPC) protocol.MessageEndpoint

func VoteOnCardEndpoint

func VoteOnCardEndpoint(r rpc.RPC) protocol.MessageEndpoint

Types

type Config

type Config struct {
	Host       string
	Port       int
	PublicPath string

	RPC      rpc.Config
	Protocol protocol.Config
}

func NewConfig

func NewConfig() Config

func (Config) Validate

func (c Config) Validate() error

Validate returns an error if the config is invalid. TODO: (corylanou) add validation

type Server

type Server struct {
	Store   *store.Store
	GraphQL *gql.GraphQL
	RPC     rpc.RPC

	Log log.Logger
	// contains filtered or unexported fields
}

Server is the HTTP server which is used to upgrade connections to the WebSocket protocol for the RPC protocol as well as accepting GraphQL queries.

func NewServer

func NewServer(s *store.Store, g *gql.GraphQL, r rpc.RPC, rt *protocol.Router, sc *statsd.Client, c *Config, l log.Logger, ctx context.Context) *Server

NewServer returns a new instance of Server.

func (*Server) Close

func (s *Server) Close() error

func (*Server) Open

func (s *Server) Open() error

ListenAndServe listens on the configured TCP network address and handles incoming HTTP requests which are translated to Remote Procedure Calls (RPC). ListenAndServe configures the specific set of RPCs made available at the endpoint.

Jump to

Keyboard shortcuts

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