Documentation ¶
Overview ¶
Package examples contains examples that demonstrate the usage of various cn-infra components.
Directories ¶
Path | Synopsis |
---|---|
Example application "cassandra-lib" demonstrates the usage of the cassandra library in a plain go program.
|
Example application "cassandra-lib" demonstrates the usage of the cassandra library in a plain go program. |
Example program "configs-plugin" demonstrates the usage of PluginConfig API.
|
Example program "configs-plugin" demonstrates the usage of PluginConfig API. |
Example application "datasync-plugin" demonstrates the usage of the datasync API.
|
Example application "datasync-plugin" demonstrates the usage of the datasync API. |
Package etcdv3lib contains a collection of examples demonstrating the usage of the etcdv3 library.
|
Package etcdv3lib contains a collection of examples demonstrating the usage of the etcdv3 library. |
editor
Example program "editor" demonstrates CREATE/UPDATE/DELETE operations with etcdv3 library.
|
Example program "editor" demonstrates CREATE/UPDATE/DELETE operations with etcdv3 library. |
model/phonebook
Package phonebook is a generated protocol buffer package.
|
Package phonebook is a generated protocol buffer package. |
view
Example program "view" shows how to read data from etcdv3 datastore.
|
Example program "view" shows how to read data from etcdv3 datastore. |
watcher
Example program *watcher* shows how to watch for changes in etcdv3 datastore.
|
Example program *watcher* shows how to watch for changes in etcdv3 datastore. |
Example program "flags-lib" demonstrates how to register CLI flags and how to display their runtime values.
|
Example program "flags-lib" demonstrates how to register CLI flags and how to display their runtime values. |
Package grpcplugin contains grpc server & grpc client example.
|
Package grpcplugin contains grpc server & grpc client example. |
grpc-server
Example demonstrates the use of GRPC plugin API.
|
Example demonstrates the use of GRPC plugin API. |
Package kafkalib contains multiple examples with the kafka library.
|
Package kafkalib contains multiple examples with the kafka library. |
asyncproducer
Asyncproducer is a simple command line tool for sending messages to Kafka using an asynchronous Kafka producer.
|
Asyncproducer is a simple command line tool for sending messages to Kafka using an asynchronous Kafka producer. |
consumer
Consumer is a simple command line tool for consuming a Kafka topic and printing the received messages to the stdout.
|
Consumer is a simple command line tool for consuming a Kafka topic and printing the received messages to the stdout. |
mux
Mux is a simple command line tool demonstrating the usage of Kafka multiplexer API.
|
Mux is a simple command line tool demonstrating the usage of Kafka multiplexer API. |
syncproducer
Syncproducer is simple command line tool for sending messages to Kafka using a synchronous Kafka producer.
|
Syncproducer is simple command line tool for sending messages to Kafka using a synchronous Kafka producer. |
utils
Package utils implements various tools used in examples for Kafka library.
|
Package utils implements various tools used in examples for Kafka library. |
Package kafkaplugin contains multiple examples with the kafka plugin.
|
Package kafkaplugin contains multiple examples with the kafka plugin. |
hash-partitioner
Example "hash-partitioner" demonstrates the use of Kafka plugin API with automatic (hash-based) partitioning.
|
Example "hash-partitioner" demonstrates the use of Kafka plugin API with automatic (hash-based) partitioning. |
manual-partitioner
Example "manual-partitioner" demonstrates the use of Kafka plugin API with a focus on manual partitioning.
|
Example "manual-partitioner" demonstrates the use of Kafka plugin API with a focus on manual partitioning. |
post-init-consumer
Example "later-stage" demonstrates the use partition watcher initialized and used after multiplexer Init()
|
Example "later-stage" demonstrates the use partition watcher initialized and used after multiplexer Init() |
Package logslib contains multiple examples showing how to use the logger library with a focus on switching between the log levels.
|
Package logslib contains multiple examples showing how to use the logger library with a focus on switching between the log levels. |
basic
Example "basic" presents the most commonly used APIs of the logger library.
|
Example "basic" presents the most commonly used APIs of the logger library. |
custom
Example "custom" shows how to customize the logger.
|
Example "custom" shows how to customize the logger. |
http
Example "http" demonstrates how to change the log level remotely via REST.
|
Example "http" demonstrates how to change the log level remotely via REST. |
Example "logs-plugin" shows how to use the logger library from a simple plugin.
|
Example "logs-plugin" shows how to use the logger library from a simple plugin. |
Package etcdexample explains how to generate Golang structures from protobuf-formatted data.
|
Package etcdexample explains how to generate Golang structures from protobuf-formatted data. |
Package redislib contains a collection of examples demonstrating the usage of the redis library.
|
Package redislib contains a collection of examples demonstrating the usage of the redis library. |
airport
A bit more advanced example demonstrating the redis library API.
|
A bit more advanced example demonstrating the redis library API. |
airport/model
Package flight defines protobuf-formatted data as used by the airport example.
|
Package flight defines protobuf-formatted data as used by the airport example. |
simple
A simple example demonstrating the redis library API.
|
A simple example demonstrating the redis library API. |
Example demonstrates creating a Redis plugin
|
Example demonstrates creating a Redis plugin |
Example simple-agent shows how easily a set of CN-infra based plugins can be turned into an application.
|
Example simple-agent shows how easily a set of CN-infra based plugins can be turned into an application. |
Example application "statuscheck-plugin" demonstrates the usage of statusCheck plugin etcdv3-plugin is monitored by StatusCheck plugin and examplePlugin reads the state.
|
Example application "statuscheck-plugin" demonstrates the usage of statusCheck plugin etcdv3-plugin is monitored by StatusCheck plugin and examplePlugin reads the state. |
Click to show internal directories.
Click to hide internal directories.