pi

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2018 License: Apache-2.0 Imports: 6 Imported by: 27

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetGlobalPi

func SetGlobalPi(cfg *config.Config)

Types

type Pi

type Pi struct {
	Db   *db.Database
	Etcd *etcd.Etcd
	// contains filtered or unexported fields
}

func Global

func Global() *Pi

func NewPi

func NewPi(cfg *config.Config) *Pi
Example
package main

import (
	"fmt"

	"openpitrix.io/openpitrix/pkg/config"
	"openpitrix.io/openpitrix/pkg/logger"
	"openpitrix.io/openpitrix/pkg/pi"
)

func main() {
	// TODO: Automatic startup dependent services.
	cfg := config.LoadConf()
	logger.SetLevelByString("debug")
	cfg.Mysql.Host = "localhost"
	cfg.Etcd.Endpoints = "localhost:2379"
	p := pi.NewPi(cfg)
	fmt.Println(p.GlobalConfig())
}
Output:

func (*Pi) GlobalConfig

func (p *Pi) GlobalConfig() (globalCfg *config.GlobalConfig)

func (*Pi) ThreadWatchGlobalConfig

func (p *Pi) ThreadWatchGlobalConfig(cb globalCfgWatcher)

Jump to

Keyboard shortcuts

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