Documentation ¶
Overview ¶
Package workerserver provides a way for a worker to set up servers for both gRPC and HTTP communication.
Index ¶
- func ConvertToStreamArtifactEventsResponse(event resultstore.ArtifactEvent) *v1.StreamArtifactEventsResponse
- func ConvertToStreamLogsResponse(line resultstore.LogLine) *v1.StreamLogsResponse
- func ConvertToStreamStatusEventsResponse(update resultstore.StatusUpdate) *v1.StreamStatusEventsResponse
- type ArtifactFileOpener
- type Ping
- type Server
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 ¶
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.