Code Monkey home page Code Monkey logo

cat-c-client's Introduction

Cat Client for C

中文文档

The ccat can be compiled and used on both Linux (both glibc and musl-libc) and OSX.

The following Operating Systems are tested:

  • OSX (>=10.13)
  • Alpine linux
  • CentOS 6
  • CentOS 7
  • Ubuntu 14.04 LTS
  • Ubuntu 16.04 LTS
  • Ubuntu 18.04 LTS

We also offered a cpp version, please refer to cppcat for further information.

Compilation

You need to have a C compiler (supporting C99) installed.

You also need to have cmake and make installed, which are used for building static or dynamic libraries and executable binary files.

Once you have your environment ready, it's easy to build and install ccat.

(In the project root dir, which contains CMakeLists.txt)

mkdir -p cmake
cd cmake && cmake .. && make -j

Docker integration example

In the ccat project root directory. (current directory)

docker build -f docker/alpine.df . -t ccat:alpine
docker build -f docker/centos6.df . -t ccat:centos6
docker build -f docker/centos7.df . -t ccat:centos7
docker build -f docker/ubuntu1404.df . -t ccat:ubuntu14.04
docker build -f docker/ubuntu1604.df . -t ccat:ubuntu16.04
docker build -f docker/ubuntu1804.df . -t ccat:ubuntu18.04

Installation

The following command will install libcatclient.so (or .dylib in osx) to your LD_LIBRARY_PATH, which is /usr/local/lib in most cases.

make install

Now it can be used as a built-in shared library.

gcc -lcatclient x.c

Initialization

Some preparations needs to be done before initializing ccat.

With all the preparations done, it's easy to initialize ccat in your c codes.

#include <client.h>

catClientInit("appkey");

Only English characters (a-z, A-Z), numbers (0-9), underscore (_) and dash (-) are allowed in appkey.

Note that sampling, built-in heartbeat and binary encoder are enabled by default, which you may want to disable it. We also offered an API to customize your initialization, please refer to our API doc.

Documentation

API doc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.