workerserver

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package workerserver provides a way for a worker to set up servers for both gRPC and HTTP communication.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToStreamArtifactEventsResponse

func ConvertToStreamArtifactEventsResponse(event resultstore.ArtifactEvent) *v1.StreamArtifactEventsResponse

ConvertToStreamArtifactEventsResponse converts a resultstore artifact event to the equivalent response type.

func ConvertToStreamLogsResponse

func ConvertToStreamLogsResponse(line resultstore.LogLine) *v1.StreamLogsResponse

ConvertToStreamLogsResponse converts a resultstore log line to the equivalent response type.

func ConvertToStreamStatusEventsResponse

func ConvertToStreamStatusEventsResponse(update resultstore.StatusUpdate) *v1.StreamStatusEventsResponse

ConvertToStreamStatusEventsResponse converts a resultstore status update to the equivalent response type.

Types

type ArtifactFileOpener

type ArtifactFileOpener interface {
	// OpenArtifactFile gets an io.ReadCloser for the artifact with the given ID.
	OpenArtifactFile(artifactID uint) (io.ReadCloser, error)
}

ArtifactFileOpener is an interface that provides a way to read an artifact file's data using the artifact's ID.

type Ping

type Ping struct {
	Message string `json:"message" example:"pong"`
}

Ping is the response from a GET /api/ request.

type Server

type Server interface {
	Serve(bindAddress string) error
	Close() error
}

Server contains both a gRPC server and an HTTP server.

It provides an easy way to start both of these servers simultaneously, listening and responding to requests to either.

func New

func New(store resultstore.Store, artifactOpener ArtifactFileOpener) Server

New creates a new server that can handle both HTTP and gRPC requests.

Directories

Path Synopsis
Package docs GENERATED BY SWAG; DO NOT EDIT This file was generated by swaggo/swag
Package docs GENERATED BY SWAG; DO NOT EDIT This file was generated by swaggo/swag

Jump to

Keyboard shortcuts

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