server

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Server)

Option is customization for server configuration.

func WithAuth

func WithAuth(c auth.Checker) Option

WithAuth is an option to enable auth checker for Server

type Server

type Server struct {
	pb.UnimplementedResultsServer
	pb.UnimplementedLogsServer
	// contains filtered or unexported fields
}

Server with implementation of API server

func New

func New(config *config.Config, logger *zap.SugaredLogger, db *gorm.DB, opts ...Option) (*Server, error)

New set up environment for the api server

func (*Server) CreateRecord

func (s *Server) CreateRecord(ctx context.Context, req *pb.CreateRecordRequest) (*pb.Record, error)

CreateRecord creates a new record in the database.

func (*Server) CreateResult

func (s *Server) CreateResult(ctx context.Context, req *pb.CreateResultRequest) (*pb.Result, error)

CreateResult creates a new result in the database.

func (*Server) DeleteLog added in v0.5.0

func (s *Server) DeleteLog(ctx context.Context, req *pb.DeleteLogRequest) (*empty.Empty, error)

DeleteLog deletes a given record and the stored log.

func (*Server) DeleteRecord

func (s *Server) DeleteRecord(ctx context.Context, req *pb.DeleteRecordRequest) (*empty.Empty, error)

DeleteRecord deletes a given record.

func (*Server) DeleteResult

func (s *Server) DeleteResult(ctx context.Context, req *pb.DeleteResultRequest) (*empty.Empty, error)

DeleteResult deletes a given result.

func (*Server) GetLog added in v0.5.0

func (s *Server) GetLog(req *pb.GetLogRequest, srv pb.Logs_GetLogServer) error

GetLog streams log record by log request

func (*Server) GetRecord

func (s *Server) GetRecord(ctx context.Context, req *pb.GetRecordRequest) (*pb.Record, error)

GetRecord returns a single Record.

func (*Server) GetRecordListSummary added in v0.9.0

func (s *Server) GetRecordListSummary(ctx context.Context, req *pb.RecordListSummaryRequest) (*pb.RecordListSummary, error)

GetRecordListSummary returns the summary and aggregation for a given list of records

func (*Server) GetResult

func (s *Server) GetResult(ctx context.Context, req *pb.GetResultRequest) (*pb.Result, error)

GetResult returns a single Result.

func (*Server) ListLogs added in v0.5.0

ListLogs returns list log records

func (*Server) ListRecords

func (s *Server) ListRecords(ctx context.Context, req *pb.ListRecordsRequest) (*pb.ListRecordsResponse, error)

ListRecords returns list records from the database.

func (*Server) ListResults

func (s *Server) ListResults(ctx context.Context, req *pb.ListResultsRequest) (*pb.ListResultsResponse, error)

ListResults returns list results from the database.

func (*Server) UpdateLog added in v0.5.0

func (s *Server) UpdateLog(srv pb.Logs_UpdateLogServer) error

UpdateLog updates log record content

func (*Server) UpdateRecord

func (s *Server) UpdateRecord(ctx context.Context, req *pb.UpdateRecordRequest) (*pb.Record, error)

UpdateRecord updates a record in the database.

func (*Server) UpdateResult

func (s *Server) UpdateResult(ctx context.Context, req *pb.UpdateResultRequest) (*pb.Result, error)

UpdateResult updates a Result in the database.

Directories

Path Synopsis
Package record provides utilities for manipulating and validating Records.
Package record provides utilities for manipulating and validating Records.
Package result provides utilities for manipulating and validating Results.
Package result provides utilities for manipulating and validating Results.

Jump to

Keyboard shortcuts

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