grpc_server

package module
v0.0.0-...-fe55c91 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: MIT Imports: 13 Imported by: 0

README

gRPC Server

Brand new microservice project powered by Go, gRPC and MinIO

gRPC Servers

Documentation

Index

Constants

View Source
const (
	DataDir = "./data"
	TempDir = "./tmp"

	StatsInitialProcessing = "initialProcessing"
	StatsLastProcessing    = "lastProcessing"
	StatsCount             = "count"
	StatsSize              = "size"
	StatsWorker            = "worker"
	StatsWorkingTime       = "workingTime"

	DefaultDateFormat = "2006-01-02 15:04:05"
)

Variables

View Source
var (
	ServerStats *expvar.Map
)

Functions

func BulkInsert

func BulkInsert(db *gorm.DB, tableName, cols, path string) *gorm.DB

func EnsureDir

func EnsureDir(dir string) error

func GetServerStats

func GetServerStats() *proto.ServerStats

func ResetServerStats

func ResetServerStats(extras ...string)

Types

type Config

type Config struct {
	App struct {

		// Receiver
		Receiver struct {
			Insecure   bool
			StorageDir string `json:"storage-dir"`
			Address    string
			Classifier struct {
				Address string
			}
		}

		// Classifier
		Classifier struct {
			Address  string
			Insecure bool
			Notifier struct {
				Address string
			}
		}

		// Notifier
		Notifier struct {
			Address  string
			Insecure bool
		}

		Storage struct {
			Address          string
			Bucket           string
			AccessKey        string `json:"access-key"`
			SecretKey        string `json:"secret-key"`
			RetentionTimeSec int    `json:"retention-time-sec"`
		}
	}

	Spring struct {
		Datasource struct {
			Url      string
			Username string
			Password string
		}
	}
}

func LoadConfig

func LoadConfig() (*Config, error)

type ConnStatsHandler

type ConnStatsHandler struct {
	From string
	To   string
	Log  *logrus.Logger
}

func (*ConnStatsHandler) HandleConn

func (c *ConnStatsHandler) HandleConn(ctx context.Context, connStats stats.ConnStats)

func (*ConnStatsHandler) HandleRPC

func (c *ConnStatsHandler) HandleRPC(ctx context.Context, rpcStats stats.RPCStats)

func (*ConnStatsHandler) TagConn

func (*ConnStatsHandler) TagRPC

type Device

type Device struct {
	Id   int64
	Code string
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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