This section is empty.


This section is empty.


This section is empty.


type Endpoint

type Endpoint struct {
	Hostname     string
	HTTPMethod   string
	PathTemplate string
	PathMatcher  *regexp.Regexp

	ServiceName  string
	ResourceName string

    An Endpoint is an API endpoint associated with a (host, method, path)

    func (Endpoint) String

    func (e Endpoint) String() string

      String returns a constructor without field names.

      type Tree

      type Tree struct {
      	// contains filtered or unexported fields

        A Tree is a prefix tree for matching endpoints based on http requests.

        func NewTree

        func NewTree(es ...Endpoint) *Tree

          NewTree creates a new Tree. You can optionally pass endpoints to add to the tree.

          func (*Tree) Add

          func (t *Tree) Add(es ...Endpoint)

            Add adds zero or more endpoints to the tree.

            func (*Tree) Get

            func (t *Tree) Get(hostname string, httpMethod string, httpPath string) (Endpoint, bool)

              Get attempts to find the endpoints associated with the given hostname, http http method and http path. It returns false if no endpoints matched.

              Source Files