server

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2019 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultNatsOptions = &nats.Options{
	Host:   "0.0.0.0",
	Port:   4222,
	NoLog:  false,
	NoSigs: true,
	Cluster: nats.ClusterOpts{
		Host: "0.0.0.0",
		Port: 4248,
	},
}

DefaultNatsOptions are the default setting to start nats with

Functions

func RunNatsServer added in v0.12.0

func RunNatsServer(seeds string, port, clusterPort int) error

RunNatsServer starts a nats server in a separate goroutine

Types

type Server

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

Server is the object which sets up the server and handles all server operations

func New

func New(nodeID string) (*Server, error)

New creates a new server instance

func (*Server) Aggregate

func (s *Server) Aggregate(ctx context.Context, in *pb.AggregateRequest) (*pb.Response, error)

Aggregate aggregates document(s) from the database

func (*Server) Batch

func (s *Server) Batch(ctx context.Context, in *pb.BatchRequest) (*pb.Response, error)

Batch performs a batch operation on the database

func (*Server) Call

func (s *Server) Call(ctx context.Context, in *pb.FunctionsRequest) (*pb.Response, error)

Call invokes a function on the provided services

func (*Server) Create

func (s *Server) Create(ctx context.Context, in *pb.CreateRequest) (*pb.Response, error)

Create inserts document(s) into the database

func (*Server) CreateFolder

func (s *Server) CreateFolder(ctx context.Context, in *pb.CreateFolderRequest) (*pb.Response, error)

CreateFolder creates a new folder

func (*Server) Delete

func (s *Server) Delete(ctx context.Context, in *pb.DeleteRequest) (*pb.Response, error)

Delete deletes document(s) from the database

func (*Server) DeleteFile

func (s *Server) DeleteFile(ctx context.Context, in *pb.DeleteFileRequest) (*pb.Response, error)

DeleteFile deletes a file

func (*Server) DownloadFile

func (s *Server) DownloadFile(in *pb.DownloadFileRequest, stream pb.SpaceCloud_DownloadFileServer) error

DownloadFile downloads a file

func (*Server) EditProfile

func (s *Server) EditProfile(ctx context.Context, in *pb.EditProfileRequest) (*pb.Response, error)

EditProfile edits a user's profiles

func (Server) InitRoutes added in v0.10.0

func (s Server) InitRoutes(profiler bool, staticPath string)

InitRoutes initialises the http routes

func (Server) InitSecureRoutes added in v0.10.0

func (s Server) InitSecureRoutes(profiler bool, staticPath string)

InitSecureRoutes initialises the http routes

func (*Server) ListFiles

func (s *Server) ListFiles(ctx context.Context, in *pb.ListFilesRequest) (*pb.Response, error)

ListFiles lists all files in the provided folder

func (*Server) LoadConfig

func (s *Server) LoadConfig(config *config.Config) error

LoadConfig configures each module to to use the provided config

func (*Server) Profile

func (s *Server) Profile(ctx context.Context, in *pb.ProfileRequest) (*pb.Response, error)

Profile queries the user's profiles

func (*Server) Profiles

func (s *Server) Profiles(ctx context.Context, in *pb.ProfilesRequest) (*pb.Response, error)

Profiles queries all user profiles

func (*Server) PubsubPublish added in v0.12.0

func (s *Server) PubsubPublish(ctx context.Context, in *pb.PubsubPublishRequest) (*pb.Response, error)

PubsubPublish publishes to the pubsub module, using the pubsub module

func (*Server) PubsubSubscribe added in v0.12.0

func (s *Server) PubsubSubscribe(stream pb.SpaceCloud_PubsubSubscribeServer) error

PubsubSubscribe subscribes to a particular subject, using the pubsub module

func (*Server) Read

func (s *Server) Read(ctx context.Context, in *pb.ReadRequest) (*pb.Response, error)

Read queries document(s) from the database

func (*Server) RealTime

func (s *Server) RealTime(stream pb.SpaceCloud_RealTimeServer) error

RealTime registers and handles all opertions of a live query

func (*Server) RoutineMetrics

func (s *Server) RoutineMetrics()

RoutineMetrics routinely sends anonymous metrics

func (*Server) Service

func (s *Server) Service(stream pb.SpaceCloud_ServiceServer) error

Service registers and handles all opertions of a service

func (*Server) SetConfig added in v0.10.0

func (s *Server) SetConfig(c *config.Config, isProd bool)

SetConfig sets the config

func (*Server) SetConfigFilePath added in v0.10.0

func (s *Server) SetConfigFilePath(configFilePath string)

SetConfigFilePath sets the config file path

func (*Server) SignIn

func (s *Server) SignIn(ctx context.Context, in *pb.SignInRequest) (*pb.Response, error)

SignIn signs a user in

func (*Server) SignUp

func (s *Server) SignUp(ctx context.Context, in *pb.SignUpRequest) (*pb.Response, error)

SignUp signs up a user

func (*Server) Start

func (s *Server) Start(seeds string, disableMetrics bool) error

Start begins the server operations

func (*Server) Update

func (s *Server) Update(ctx context.Context, in *pb.UpdateRequest) (*pb.Response, error)

Update updates document(s) from the database

func (*Server) UploadFile

func (s *Server) UploadFile(stream pb.SpaceCloud_UploadFileServer) error

UploadFile uploads a file

Jump to

Keyboard shortcuts

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