logserver

module
v0.0.0-...-7b65136 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: MIT

README

LogServer Build Status

User behavior event log collection service.

event_log.proto

Usage

go build service/cmd/logservice/main.go

logservice -option
Usage
  -debug.addr string
    	Debug and metrics listen address (default ":5060")
  -grpc.addr string
    	gRPC (HTTP) listen address (default ":5040")
  -http.addr string
    	HTTP listen address (default ":5050")
  -storage.data_type string
    	protobuf|json. Data type that store in storage
  -storage.kafka.addrs string
    	Kafka broker addresses, multiple values are comma separated
  -storage.types string
    	stdout|kafka. Multiple values are comma separated

Custom

package main

import (
	"flag"

	"github.com/techxmind/logserver/config"
	"github.com/techxmind/logserver/service/svc/server"
)

func main() {
	flag.Parse()

    // init config or load config from file
    cfg := &config.Config{}
	server.Run(cfg)
}

Client

Support both gGRPC and HTTP protocol.

HTTP example: Post single event, can use json or protobuf data format. See interface-defs/event_log.proto EventLog for data structure.

curl -H "Content-Type: application/json" --data-binary @single-event.json http://logserver-host/s
curl -H "Content-Type: application/protobuf" --data-binary @single-event.pb http://logserver-host/s

Post multiple events, can use json or protobuf data format. See interface-defs/event_log.proto EventLogs for data structure.

curl -H "Content-Type: application/json" --data-binary @multiple-events.json http://logserver-host/mul
curl -H "Content-Type: application/protobuf" --data-binary @multiple-events.pb http://logserver-host/mul

Directories

Path Synopsis
service
svc
svc/client/grpc
Package grpc provides a gRPC client for the LogService service.
Package grpc provides a gRPC client for the LogService service.
svc/client/http
Package http provides an HTTP client for the LogService service.
Package http provides an HTTP client for the LogService service.

Jump to

Keyboard shortcuts

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