api

package
v0.2.0 Latest Latest
Warning

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

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

README

Protobuf API

Style Conventions

This folder contains all protobuf files defining our API. We follow the Google Cloud's API design guide, including the following conventions:

  • Ordering:
    1. syntax, package, import, option statements
    2. overview documentation
    3. service definition(s)
    4. request and response messages (ordered as respective methods)
    5. resource messages while parents are defined before child resources
  • File names:
    • <lower_case_underscore_separated_names>.proto
    • File name corresponding to (single) service
  • proto file only containing resources, consider naming this file simply as resources.proto
  • ENUM (Scale): The first value should be named ENUM_TYPE_UNSPECIFIED
  • Commenting: Comment services, RPCs and messages
  • Request and response messages
Method name Request Body Response Body
ListBooks ListBooksRequest List*Response
GetBook GetBookRequest Book
CreateBook CreateBookRequest Book
UpdateBook UpdateBookRequest Book
RenameBook RenameBookRequest RenameBookResponse
DeleteBook DeleteBookRequest google.brotobuf.Empty
  • Even if we transfer a single resource we create a corresponding XxxRequest message. XxxRequest allows adding new fields to the request (e.g. metadata) while not breaking the code.

Generate Go files

At root level, generate all necessary Go files with the command go generate ./... or execute the corresponding command(s) in proto.go manually.

Documentation

Index

Constants

View Source
const (
	DatabaseErrorMsg         = "DB error"
	ServiceIDIsMissingErrMsg = "Service ID is missing"
)

Variables

This section is empty.

Functions

func InitEvalStream

func InitEvalStream(hostport string, additionalOpts ...grpc.DialOption) (stream evaluation.Evaluation_SendEvidencesClient, err error)

InitEvalStream initializes a stream to the Evaluation Manager

Types

This section is empty.

Directories

Path Synopsis
Package configuration is a reverse proxy.
Package configuration is a reverse proxy.
Package evaluation is a reverse proxy.
Package evaluation is a reverse proxy.

Jump to

Keyboard shortcuts

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