tag

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTagRouter

func NewTagRouter(url *common.URL, notify chan struct{}) (*tagRouter, error)

NewTagRouter returns a tagRouter instance if url is not nil

func NewTagRouterFactory

func NewTagRouterFactory() router.PriorityRouterFactory

NewTagRouterFactory create a tagRouterFactory

Types

type FileTagRouter

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

FileTagRouter Use for parse config file of Tag router

func NewFileTagRouter

func NewFileTagRouter(content []byte) (*FileTagRouter, error)

NewFileTagRouter Create file tag router instance with content (from config file) todo fix this router, now it is useless, tag router is nil

func (*FileTagRouter) Priority

func (f *FileTagRouter) Priority() int64

Priority Return Priority in listenable router

func (*FileTagRouter) Route

func (f *FileTagRouter) Route(invokers *roaring.Bitmap, cache router.Cache, url *common.URL, invocation protocol.Invocation) *roaring.Bitmap

func (*FileTagRouter) URL

func (f *FileTagRouter) URL() *common.URL

URL Return URL in file tag router n

type RouterRule

type RouterRule struct {
	router.BaseRouterRule `yaml:",inline"`
	Tags                  []Tag
	AddressToTagNames     map[string][]string
	TagNameToAddresses    map[string][]string
}

*

  • %YAML1.2
  • ---
  • force: true
  • runtime: false
  • enabled: true
  • priority: 1
  • key: demo-provider
  • tags:
  • - name: tag1
  • addresses: [ip1, ip2]
  • - name: tag2
  • addresses: [ip3, ip4]
  • ...

RouterRule RouterRule config read from config file or config center

type Tag added in v1.5.1

type Tag struct {
	Name      string
	Addresses []string
}

Jump to

Keyboard shortcuts

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