core

package
v0.0.0-...-52789aa Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2018 License: BSD-3-Clause Imports: 10 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assets

func Assets(namespace string) (*packr.Box, error)

Assets return a packr box which contains all assets

Types

type JSONSchemaErr

type JSONSchemaErr struct {
	Field       string `json:"field"`
	Type        string `json:"type"`
	Description string `json:"description"`
}

JSONSchemaErr describe error in schema validation.

type JSONValidationResult

type JSONValidationResult struct {
	Valid  bool
	Errors []JSONSchemaErr
}

JSONValidationResult describe result of the schema validation.

func ValidateJSON

func ValidateJSON(root, schema, input string) (*JSONValidationResult, error)

ValidateJSON check a JSON string against a JSON schema. See: http://json-schema.org/

type Kafka

type Kafka struct {
	Producer sarama.SyncProducer
}

Kafka handle Kafka connection. The producer use a WaitForAll strategy to perform message ack.

func GetKafka

func GetKafka() *Kafka

GetKafka return the kafka instance.

func (*Kafka) Close

func (k *Kafka) Close() error

Close the producer.

type RequestLogger

type RequestLogger struct {
	LogType string
	Level   log.Level
}

RequestLogger wrap logrus to a compliant negroni logger. Log level can be defined through Level.

func (RequestLogger) Printf

func (rl RequestLogger) Printf(format string, v ...interface{})

Printf to logrus.

func (RequestLogger) Println

func (rl RequestLogger) Println(v ...interface{})

Println to logrus.

Directories

Path Synopsis
io
in
out

Jump to

Keyboard shortcuts

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