common

package
v0.0.0-...-bdba56e Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const MONGO_RS_DOCKER_COMPOSE = `` /* 1155-byte string literal not displayed */
View Source
const REPLICA_SET_CONFG = `` /* 192-byte string literal not displayed */
View Source
const SETUP_DOCKER = `FROM mongo:4

COPY replicaSet.js .
COPY setup.sh .
`
View Source
const SETUP_SHELL = `#!/usr/bin/env bash

set -e

sleep 10 | echo Sleeping

mongo mongodb://mongo-rs0-0:27017 < replicaSet.js`

Variables

This section is empty.

Functions

func GetLocalIP

func GetLocalIP() (string, error)

func RenderTemplateFile

func RenderTemplateFile(text string, content interface{}, outputFile string) error

func WriteFile

func WriteFile(filename, content string) (int, error)

Types

type ResourceConfig

type ResourceConfig struct {
	Kind         string `yaml:"kind"`
	Host         string `yaml:"host"`
	DataDir      string `yaml:"data-dir"`
	SetupDir     string `yaml:"setup-dir"`
	DatabaseName string `yaml:"database"`
	User         string `yaml:"user"`
	Password     string `yaml:"password"`
}

func DefaultMongoDBConfig

func DefaultMongoDBConfig() *ResourceConfig

func DefaultMongoReplicaSetConfig

func DefaultMongoReplicaSetConfig() *ResourceConfig

func NewResourceConfig

func NewResourceConfig() *ResourceConfig

func ReadConfig

func ReadConfig(reader io.Reader) (*ResourceConfig, error)

func ReadConfigFromFile

func ReadConfigFromFile(name string) (*ResourceConfig, error)

Jump to

Keyboard shortcuts

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