server

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: Apache-2.0 Imports: 23 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)

func WithAuth

func WithAuth(c auth.Checker) Option

type Server

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

Server with implementation of API server

func New

func New(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)

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) 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) GetRecord

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

GetRecord returns a single Record.

func (*Server) GetResult

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

GetResult returns a single Result.

func (*Server) ListRecords

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

func (*Server) ListResults

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

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