api

package module
v0.0.0-...-315bef2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: Apache-2.0 Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

pcap-api

Frontend API for the pcap-agent backend

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	LogLevel:           "debug",
	Listen:             ":8080",
	EnableServerTLS:    false,
	Cert:               "test/server.crt",
	Key:                "test/server.key",
	CfAPI:              "",
	BoshDirectorAPI:    "",
	AgentPort:          "9494",
	ClientCert:         "test/client.crt",
	ClientCertKey:      "test/client.key",
	AgentCa:            "test/cacert.pem",
	AgentCommonName:    "",
	AgentTlsSkipVerify: true,
	CLIDownloadRoot:    "cli/build",
}

Functions

func VerifyJwt

func VerifyJwt(tokenString string, neededScope string, issuers []string) (bool, error)

Types

type Api

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

func NewApi

func NewApi(c *Config) (*Api, error)

func (*Api) Run

func (a *Api) Run()

func (*Api) Stop

func (a *Api) Stop()

type BoshCaptureHandler

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

func NewBoshCaptureHandler

func NewBoshCaptureHandler(config *Config) *BoshCaptureHandler

type BoshInfo

type BoshInfo struct {
	Name            string `json:"name"`
	Uuid            string `json:"uuid"`
	Version         string `json:"version"`
	Cpi             string `json:"cpi"`
	StemcellOs      string `json:"stemcell_os"`
	StemcellVersion string `json:"stemcell_version"`

	UserAuthentication struct {
		Type    string `json:"type"`
		Options struct {
			Url  string   `json:"url"`
			Urls []string `json:"urls"`
		} `json:"options"`
	} `json:"user_authentication"`
}

type CfCaptureHandler

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

func NewCfCaptureHandler

func NewCfCaptureHandler(config *Config) *CfCaptureHandler

type Config

type Config struct {
	LogLevel           string `yaml:"log_level"`
	Listen             string `yaml:"listen"`
	EnableServerTLS    bool   `yaml:"enable_server_tls"`
	Cert               string `yaml:"cert"`
	Key                string `yaml:"key"`
	CfAPI              string `yaml:"cf_api"`
	BoshDirectorAPI    string `yaml:"bosh_director_api"`
	BoshDirectorCa     string `yaml:"bosh_director_ca"`
	AgentPort          string `yaml:"agent_port"`
	ClientCert         string `yaml:"client_cert"`
	ClientCertKey      string `yaml:"client_key"`
	AgentCa            string `yaml:"agent_ca"`
	AgentCommonName    string `yaml:"agent_common_name"`
	AgentTlsSkipVerify bool   `yaml:"agent_tls_skip_verify"`
	CLIDownloadRoot    string `yaml:"cli_download_root"`
}

TODO: Consider splitting this into pcap-api, cf and bosh parts. cf and bosh could then be used to _not_ enable a specific capture endpoint when there's no configuration for it.

func NewConfigFromFile

func NewConfigFromFile(filename string) (*Config, error)

type Handlers

type Handlers struct {
	Bosh bool `json:"bosh"`
	Cf   bool `json:"cf"`
}

type PcapStreamer

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

func NewPcapStreamer

func NewPcapStreamer(config *Config) *PcapStreamer

type Status

type Status struct {
	Up       bool     `json:"Up"`
	Handlers Handlers `json:"handlers"`
}

type StringSet

type StringSet map[string]struct{}

type UaaKeyInfo

type UaaKeyInfo struct {
	Kty   string `json:"kty"`
	E     string `json:"e"`
	Use   string `json:"use"`
	Kid   string `json:"kid"`
	Alg   string `json:"alg"`
	Value string `json:"value"`
	N     string `json:"n"`
}

UaaKeyInfo holds the response of the UAA /token_keys endpoint

Directories

Path Synopsis
cmd
pcap-api command
pcap-bosh-cli command

Jump to

Keyboard shortcuts

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