admin

package
v0.2.16 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidAdminPort = errors.New("invalid port number for Admin server")

ErrInvalidAdminPort occurs when the port in the config is invalid.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port int `yaml:"Port"`
}

Config is the configuration for creating a Server.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the port number.

type Server

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

Server is the gRPC server for admin service.

func NewServer

func NewServer(conf *Config, be *backend.Backend) *Server

NewServer creates a new Server.

func (*Server) CreateProject

func (s *Server) CreateProject(
	ctx context.Context,
	req *api.CreateProjectRequest,
) (*api.CreateProjectResponse, error)

CreateProject creates a new project.

func (*Server) GRPCServer

func (s *Server) GRPCServer() *grpc.Server

GRPCServer returns the gRPC server.

func (*Server) GetDocument

func (s *Server) GetDocument(
	ctx context.Context,
	req *api.GetDocumentRequest,
) (*api.GetDocumentResponse, error)

GetDocument gets the document.

func (*Server) GetProject added in v0.2.6

func (s *Server) GetProject(
	ctx context.Context,
	req *api.GetProjectRequest,
) (*api.GetProjectResponse, error)

GetProject gets a project.

func (*Server) GetSnapshotMeta added in v0.2.11

func (s *Server) GetSnapshotMeta(
	ctx context.Context,
	req *api.GetSnapshotMetaRequest,
) (*api.GetSnapshotMetaResponse, error)

GetSnapshotMeta gets the snapshot metadata that corresponds to the server sequence.

func (*Server) ListChanges added in v0.2.9

func (s *Server) ListChanges(
	ctx context.Context,
	req *api.ListChangesRequest,
) (*api.ListChangesResponse, error)

ListChanges lists of changes for the given document.

func (*Server) ListDocuments

func (s *Server) ListDocuments(
	ctx context.Context,
	req *api.ListDocumentsRequest,
) (*api.ListDocumentsResponse, error)

ListDocuments lists documents.

func (*Server) ListProjects

func (s *Server) ListProjects(
	ctx context.Context,
	req *api.ListProjectsRequest,
) (*api.ListProjectsResponse, error)

ListProjects lists all projects.

func (*Server) LogIn added in v0.2.14

func (s *Server) LogIn(
	ctx context.Context,
	req *api.LogInRequest,
) (*api.LogInResponse, error)

LogIn logs in a user.

func (*Server) SearchDocuments added in v0.2.13

func (s *Server) SearchDocuments(
	ctx context.Context,
	req *api.SearchDocumentsRequest,
) (*api.SearchDocumentsResponse, error)

SearchDocuments searches documents for a specified string.

func (*Server) Shutdown

func (s *Server) Shutdown(graceful bool)

Shutdown shuts down this server.

func (*Server) SignUp added in v0.2.14

func (s *Server) SignUp(
	ctx context.Context,
	req *api.SignUpRequest,
) (*api.SignUpResponse, error)

SignUp signs up a user.

func (*Server) Start

func (s *Server) Start() error

Start starts this server by opening the rpc port.

func (*Server) UpdateProject

func (s *Server) UpdateProject(
	ctx context.Context,
	req *api.UpdateProjectRequest,
) (*api.UpdateProjectResponse, error)

UpdateProject updates the project.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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