database

package
v0.15.4 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RAW_REQUESTS_COLLECTION_NAME = "raw_requests"
)

Variables

View Source
var (
	DBDefaults map[string]interface{} = map[string]interface{}{
		"mode":             os.Getenv("TICKER_MODE"),
		"address":          os.Getenv("TICKER_SERVER_ADDRESS"),
		"serverPort":       os.Getenv("TICKER_SERVER_PORT"),
		"clientPort":       "31009",
		"workDir":          []string{"/app/"},
		"mongoURL":         os.Getenv("MONGO_URL"),
		"MongoDatabaseURI": os.Getenv("MONGO_DB_URI"),
		"MongoDBUserName":  os.Getenv("MONGO_DB_USERNAME"),
		"MongoDBPassword":  os.Getenv("MONGO_DB_PASSWORD"),
		"MongoDBName":      os.Getenv("MONGO_DB_NAME"),
	}
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Address          string
	ServerPort       string
	ClientPort       string
	WorkDir          []string
	MongoDatabaseURI string
	MongoDBUserName  string
	MongoDBPassword  string
	MongoDBName      string
}

type MongoDbService

type MongoDbService struct {
	// contains filtered or unexported fields
}

MongoDbService for MongoDb

func NewMongoDbService

func NewMongoDbService(ctx context.Context, cfg *Config) (*MongoDbService, error)

NewMongoDbService creates a service to interact with MongoDb

func (*MongoDbService) InsertRawRequest

func (c *MongoDbService) InsertRawRequest(requestType, verb, kind string, body []byte) error

Jump to

Keyboard shortcuts

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