shared

package
v0.0.0-...-fcff741 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PARAM_FILE string = "params.yml"

Functions

func ObjectIdToPublicId

func ObjectIdToPublicId(id bson.ObjectId) string

func PublicIdToObjectId

func PublicIdToObjectId(id string) (bson.ObjectId, error)

Types

type AsDoormanUpdatePayloader

type AsDoormanUpdatePayloader interface {
	AsDoormanUpdatePayload() ([]byte, error)
}

type MongoParams

type MongoParams struct {
	Url                         string `yaml:"url,omitempty"`
	DatabaseName                string `yaml:"database_name,omitempty"`
	DoormanDefinitionCollection string `yaml:"doorman_definition_collection,omitempty"`
}

type NSQParams

type NSQParams struct {
	NSQLookupdUrl string `yaml:"nsq_lookupd_url,omitempty"`
}

type NanoMsgParams

type NanoMsgParams struct {
	NanoMsgUrl string `yaml:"nanomsg_url,omitempty"`
}

type Params

type Params struct {
	Port    int            `yaml:"port,omitempty"`
	Host    string         `yaml:"host,omitempty"`
	Mongo   *MongoParams   `yaml:"mongo,omitempty"`
	NSQ     *NSQParams     `yaml:"nsq,omitempty"`
	NanoMsg *NanoMsgParams `yaml:"nanomsg,omitempty"`

	Database     string `yaml:"database,omitempty"`
	MessageQueue string `yaml:"message_queue,omitempty"`
}

func GetParams

func GetParams() *Params

func LoadFromYamlData

func LoadFromYamlData(data []byte) (*Params, error)

func LoadFromYamlFile

func LoadFromYamlFile(fileName string) (*Params, error)

func (*Params) InsertDefaultValues

func (p *Params) InsertDefaultValues() *Params

func (*Params) UseMongoDb

func (p *Params) UseMongoDb() bool

func (*Params) UseNSQ

func (p *Params) UseNSQ() bool

func (*Params) UseNanomsg

func (p *Params) UseNanomsg() bool

Jump to

Keyboard shortcuts

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