cacher

command module
v0.0.0-...-0346462 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: Apache-2.0 Imports: 32 Imported by: 0

README

Cacher

Build Status

This is cacher, it gets some data from api and puts it into memory then serves it up. That is all.

cacherc

Build

From the root directory execute make cli (file will be named cmd/cacherc/cacherc)

Example output
./cacherc

cacher client

Usage:
  cacherc [command]Available Commands:
  all         Get all known hardware for facility
  help        Help about any command
  id          Get hardware by id
  ingest      Trigger cacher to ingest
  ip          Get hardware by any associated ip
  mac         Get hardware by any associated mac
  push        Push new hardware to cacher
  watch       Register to watch an id for any changesFlags:
  -f, --facility string   used to build grcp and http urls
  -h, --help              help for cacherc

  Use "cacherc [command] --help" for more information about a command.
Example commands
cacherc -f dfw2 all
cacherc -f ewr1 mac 2c:60:0c:6e:82:a7 | jq '.network_ports[0].connected_ports'
cacherc -f ny5 all | jq '.id as $id | .network_ports | map(select(.data.mac == "34:48:ed:ed:08:e2") | [$id, .data.mac])[] | @tsv' -r 2>/dev/null
cacherc -f ewr1 id 478f2376-87b3-4fb6-a52f-1fbcd83820a3 | jq '.instance.operating_system_version'
cacherc -f iad1 mac ac:1f:6b:2d:33:48 | jq '.instance.ip_addresses[0].address'
cacherc -f dfw2 id ac8eeb4e-a520-4582-b5b7-ea4fab6ebbd9 | jq

OpenTelemetry

OpenTelemetry hooks are enabled for gRPC so each gRPC transaction will generate spans and traces, as well as propagate any tracing information from clients to API.

To export traces to an opentelemetry collector on localhost, set the following:

OTEL_EXPORTER_OTLP_ENDPOINT=otel-collector:4317
OTEL_EXPORTER_OTLP_INSECURE=true

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
contrib
The hardware package provides an in memory database that contains all of the hardware info.
The hardware package provides an in memory database that contains all of the hardware info.
pkg
healthcheck
Package healthcheck provides service to get grpc server health status.
Package healthcheck provides service to get grpc server health status.
protos

Jump to

Keyboard shortcuts

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