admin

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: Apache-2.0 Imports: 17 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) 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) Shutdown

func (s *Server) Shutdown(graceful bool)

Shutdown shuts down this server.

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