go_zero_config

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: MIT Imports: 4 Imported by: 0

README

go-zero-config

Go Report Card tests GoDoc codecov MIT license

Introduction

go-zero-config is a configuration package for go-zero and go-packagist framework.

Installation

go get github.com/go-packagist/go-zero-config

Usage

package main

import (
    "github.com/go-packagist/framework/foundation"
    "github.com/go-packagist/go-zero-config"
    "github.com/stretchr/testify/assert"
    "testing"
)

func main() {
    app := foundation.NewApplication()

    app.Register(go_zero_config.NewProvider(app.Container, ".test/config.yaml"))

    assert.Equal(t, "test.config", app.MustMake("zero.config").(*go_zero_config.Config).Name)
}

License

The MIT License (MIT). Please see License File for more information.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	zrpc.RpcServerConf
}

type Provider

type Provider struct {
	*container.Container
	// contains filtered or unexported fields
}

func NewProvider

func NewProvider(c *container.Container, configFile string) *Provider

func (*Provider) Boot

func (p *Provider) Boot()

func (*Provider) Register

func (p *Provider) Register()

Jump to

Keyboard shortcuts

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