rpcserver

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: ISC Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatServerCfg

type ChatServerCfg struct {
	// Client should be set to the [client.Client] instance.
	Client *client.Client

	// Log should be set to the app's logger.
	Log slog.Logger

	// RootReplayMsgLogs is the root dir where replaymsglogs are stored for
	// supported message types.
	RootReplayMsgLogs string

	// PayClient is the payment client needed to create funded invites.
	PayClient *client.DcrlnPaymentClient

	// InviteFundsAccount is the account to use to generate invite funds.
	// Must be a non-default account in order to generate funds for
	// invites.
	InviteFundsAccount string

	OnPM  func(ctx context.Context, uid client.UserID, req *types.PMRequest) error
	OnGCM func(ctx context.Context, gcid client.GCID, req *types.GCMRequest) error
}

ChatServerCfg is the configuration for a new types.ChatServiceServer deployment.

type Config

type Config struct {
	JSONRPCListeners []net.Listener
	Log              slog.Logger
}

Config is the available configuration for a Server.

type ContentServerCfg added in v0.1.10

type ContentServerCfg struct {
	// Client should be set to the [client.Client] instance.
	Client *client.Client

	// Log should be set to the app's logger.
	Log slog.Logger

	// RootReplayMsgLogs is the root dir where replaymsglogs are stored for
	// supported message types.
	RootReplayMsgLogs string
}

type GCServerCfg added in v0.1.6

type GCServerCfg struct {
	// Client should be set to the [client.Client] instance.
	Client *client.Client

	// Log should be set to the app's logger.
	Log slog.Logger

	// RootReplayMsgLogs is the root dir where replaymsglogs are stored for
	// supported message types.
	RootReplayMsgLogs string
}

type PaymentsServerCfg

type PaymentsServerCfg struct {
	// Client should be set to the [client.Client] instance.
	Client *client.Client

	// Log should be set to the app's logger.
	Log slog.Logger

	// RootReplayMsgLogs is the root dir where replaymsglogs are stored for
	// supported message types.
	RootReplayMsgLogs string

	OnTipUser func(uid clientintf.UserID, dcrAmount float64) error
}

type PostsServerCfg

type PostsServerCfg struct {
	// Client should be set to the [client.Client] instance.
	Client *client.Client

	// Log should be set to the app's logger.
	Log slog.Logger

	// RootReplayMsgLogs is the root dir where replaymsglogs are stored for
	// supported message types.
	RootReplayMsgLogs string
}

type ResourcesServerCfg added in v0.1.8

type ResourcesServerCfg struct {
	Client *client.Client

	// Log should be set to the app's logger.
	Log slog.Logger

	// Router on which to bind the server, to fulfill requests.
	Router *resources.Router
}

type Server

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

Server is an RPC server for a corresponding BR Client instance.

func New

func New(cfg Config) *Server

func (*Server) InitChatService

func (s *Server) InitChatService(cfg ChatServerCfg) error

InitChatService initializes and binds a ChatService server to the RPC server.

func (*Server) InitContentService added in v0.1.10

func (s *Server) InitContentService(cfg ContentServerCfg) error

InitContentService initializes and binds a ContentService server to the RPC server.

func (*Server) InitGCService added in v0.1.6

func (s *Server) InitGCService(cfg GCServerCfg) error

InitGCService initializes and binds a GCService server to the RPC server.

func (*Server) InitPaymentsService

func (s *Server) InitPaymentsService(cfg PaymentsServerCfg) error

InitPostService initializes and binds a PostsService server to the RPC server.

func (*Server) InitPostsService

func (s *Server) InitPostsService(cfg PostsServerCfg) error

InitPostService initializes and binds a PostsService server to the RPC server.

func (*Server) InitResourcesService added in v0.1.8

func (s *Server) InitResourcesService(cfg ResourcesServerCfg) error

func (*Server) InitVersionService

func (s *Server) InitVersionService(appName, appVersion string)

InitVersionService inits and binds a VersionService server to the RPC server.

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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