httpapi

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Copyright 2021 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const (
	IntegrationName = "api"
)

Variables

View Source
var ErrURLUnreachable = errors.New("cannot reach url")

Functions

This section is empty.

Types

type ComponentConfig

type ComponentConfig struct {
	// contains filtered or unexported fields
}

ComponentConfig stores configuration for a server component.

func (*ComponentConfig) Enable

func (sc *ComponentConfig) Enable(host string, port int)

Enable configures and enables a server component.

func (*ComponentConfig) TLS

func (sc *ComponentConfig) TLS(certPath, keyPath string)

TLS configures and enables TLS for a server component.

func (*ComponentConfig) VerifyTLSClient

func (sc *ComponentConfig) VerifyTLSClient(caCertPath string)

VerifyTLSClient configures and enables TLS client certificate validation for a server component.

type Server

type Server struct {
	Ingest ComponentConfig
	Status ComponentConfig
	// contains filtered or unexported fields
}

Server runtime for status API server.

func NewServer

func NewServer(r status.Reporter, em emitter.Emitter) (*Server, error)

NewServer creates a new API server. Nice2Have: decouple services into path handlers. Separate HTTP API configs should be deprecated if we want to unify under a single server & port.

func (*Server) Serve

func (s *Server) Serve(ctx context.Context)

Serve serves status API requests and ingest. Nice2Have: context cancellation.

Jump to

Keyboard shortcuts

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