agollo

package
v1.0.25 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: MIT Imports: 12 Imported by: 0

README

Example

package agollo

import (
	"context"

	"github.com/why444216978/gin-api/library/apollo/agollo/listener"
	"github.com/why444216978/gin-api/library/apollo/agollo/listener/structlistener"
)

type Conf struct {
	Key string
}

func TestNew(t *testing.T) {
	conf := &Conf{}
	listeners := []listener.CustomListener{
		{
			NamespaceStruct: map[string]interface{}{
				"test.json": conf,
			},
			CustomListener: &structlistener.StructChangeListener{},
		},
	}
	New(context.Background(), "test", []string{"test.json"}, WithCustomListeners(listeners))
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, appID string, namespaces []string, opts ...Option) (err error)

Types

type ApolloClient

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

type Option

type Option func(*ApolloClient)

func WithAuth

func WithAuth(auth auth.HTTPAuth) Option

func WithBackupConfigPath

func WithBackupConfigPath(backupPath string) Option

func WithCache

func WithCache(cache agcache.CacheFactory) Option

func WithCustomListeners

func WithCustomListeners(listeners []listener.CustomListener) Option

func WithFileHandler

func WithFileHandler(fileHandler file.FileHandler) Option

func WithIsBackupConfig

func WithIsBackupConfig(isBackup bool) Option

func WithLoadBalance

func WithLoadBalance(loadBalance cluster.LoadBalance) Option

func WithLogger

func WithLogger(logger log.LoggerInterface) Option

func WithSyncServerTimeout

func WithSyncServerTimeout(syncServerTimeout int) Option

Directories

Path Synopsis
mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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