package example

import "github.com/envoyproxy/go-control-plane/internal/example"

Index

Constants

const (
	ClusterName  = "example_proxy_cluster"
	RouteName    = "local_route"
	ListenerName = "listener_0"
	ListenerPort = 10000
	UpstreamHost = "www.envoyproxy.io"
	UpstreamPort = 80
)

Functions

func GenerateSnapshot

func GenerateSnapshot() *cache.Snapshot

func RunServer

func RunServer(srv server.Server, port uint)

RunServer starts an xDS server at the given port.

Types

type Logger

type Logger struct {
	Debug bool
}

An example of a logger that implements `pkg/log/Logger`. Logs to stdout. If Debug == false then Debugf() and Infof() won't output anything.

func (Logger) Debugf

func (logger Logger) Debugf(format string, args ...interface{})

Log to stdout only if Debug is true.

func (Logger) Errorf

func (logger Logger) Errorf(format string, args ...interface{})

Log to stdout always.

func (Logger) Infof

func (logger Logger) Infof(format string, args ...interface{})

Log to stdout only if Debug is true.

func (Logger) Warnf

func (logger Logger) Warnf(format string, args ...interface{})

Log to stdout always.

type Server

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

func NewServer

func NewServer(ctx context.Context, cache cache.Cache, cb *test.Callbacks) *Server

func (*Server) Run

func (s *Server) Run(port uint)

Source Files

logger.go resource.go server.go

Directories

PathSynopsis
internal/example/main
Version
v0.13.4 (latest)
Published
Jan 6, 2025
Platform
linux/amd64
Imports
28 packages
Last checked
45 minutes ago

Tools for package owners.