consulparser

package module
v0.0.0-...-9d95271 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

README

بِسْمِ اللّٰهِ الرَّحْمٰنِ الرَّحِيْمِ


السَّلاَمُ عَلَيْكُمْ وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ


ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ

ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ

ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ


اللَّهُمَّ صَلِّ عَلَى مُحَمَّدٍ ، وَعَلَى آلِ مُحَمَّدٍ ، كَمَا صَلَّيْتَ عَلَى إِبْرَاهِيمَ وَعَلَى آلِ إِبْرَاهِيمَ ، إِنَّكَ حَمِيدٌ مَجِيدٌ ، اللَّهُمَّ بَارِكْ عَلَى مُحَمَّدٍ ، وَعَلَى آلِ مُحَمَّدٍ ، كَمَا بَارَكْتَ عَلَى إِبْرَاهِيمَ ، وَعَلَى آلِ إِبْرَاهِيمَ ، إِنَّكَ حَمِيدٌ مَجِيدٌ

Consul Parser

Parse consul config with key tag in type.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//ErrNilClient defines error for client that is nil.
	ErrNilClient = errors.New("client must not be nil")
	//ErrNonPointerType  defines error for the value that is non-pointer type.
	ErrNonPointerType = errors.New("value must be pointer type")
	//ErrUnhandledKind defines error for the kind that is not handled by this library.
	ErrUnhandledKind = errors.New("unhandled kind for assigning value to the field")
	//ErrOverflowSet defines error that will be used for overflow case.
	ErrOverflowSet = errors.New("error in set the overflowing value to the field")
	//ErrEmptyLayout defines the error for empty layout given.
	ErrEmptyLayout = errors.New("layout given is an empty string")
)

Functions

This section is empty.

Types

type Parser

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

Parser defines struct for the parser API.

func (*Parser) Parse

func (parser *Parser) Parse(target interface{}) (err error)

Parse gives the value to the target from the consul server. Parse uses the struct tag to identify the value of the key.

func (*Parser) SetTimeLayout

func (parser *Parser) SetTimeLayout(layout string) (err error)

type ParserIface

type ParserIface interface {
	Parse(interface{}) error
}

func NewParser

func NewParser(client *api.Client) (parser ParserIface, err error)

NewParser initialize a new parser with the supplied consul client.

Jump to

Keyboard shortcuts

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