cache

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache encapsulates the entire cache application state.

func NewApp

func NewApp(ctx context.Context, cfg config.Config, probe liveness.Prober) *Cache

NewApp builds a new Cache app.

func (*Cache) Close added in v1.6.0

func (c *Cache) Close() (err error)

func (*Cache) IsAlive

func (c *Cache) IsAlive(_ context.Context) bool

IsAlive checks whether a http server still alive.

func (*Cache) Serve added in v1.6.0

func (c *Cache) Serve(gsh shutdown.Gracefuller) error

Serve runs the cache server and probes, handles shutdown.

type Http added in v1.6.0

type Http interface {
	ListenAndServe()
	IsAlive() bool
	Close() error
}

Http interface exposes methods for starting and liveness probing.

type HttpServer added in v1.6.0

type HttpServer struct {
	nocopy.NoCopy
	// contains filtered or unexported fields
}

HttpServer implements Http, wraps all dependencies required for running the HTTP server.

func New added in v1.6.0

func New(
	ctx context.Context,
	cfg config.Config,
	db storage.Storage,
	backend upstream.Upstream,
	governor orchestrator.Governor,
	probe liveness.Prober,
) *HttpServer

New creates a new HttpServer, initializing metrics and the HTTP server itself. If any step fails, returns an error and performs cleanup.

func (*HttpServer) Close added in v1.6.0

func (s *HttpServer) Close() error

func (*HttpServer) IsAlive added in v1.6.0

func (s *HttpServer) IsAlive() bool

IsAlive returns true if the server is marked as alive.

func (*HttpServer) ListenAndServe added in v1.6.0

func (s *HttpServer) ListenAndServe()

ListenAndServe starts the HTTP server.

Jump to

Keyboard shortcuts

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