tables

package
v0.0.0-...-6194787 Latest Latest
Warning

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

Go to latest
Published: May 11, 2017 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package tables implements (URL, HTTP method) -> SermoCRM Action lookup tables. A table is an RPC service's set of endpoints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	// Name is the qualified name of the Action. E.g., users.Create.
	Name string

	Method string

	// Unauthenticated is true if the endpoint does not require authentication.
	Unauthenticated bool
}

Action is an RPC Action.

type Endpoint

type Endpoint struct {
	// Methods is all comma-delimited list of all the HTTP methods this endpoint
	// supports.
	Methods string

	// Actions are all the Actions that correspond to the given Endpoint.
	Actions []Action
}

Endpoint is an HTTP endpoint.

func (*Endpoint) Add

func (e *Endpoint) Add(act Action)

Add adds the Action to the Endpoint and adjusts the Action's S and E fields.

func (Endpoint) Find

func (e Endpoint) Find(method string) (Action, bool)

type Mapping

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

Mapping maps (URL, HTTP method) -> SermoCRM Actions.

func MakeMapping

func MakeMapping(fns ...func() Table) Mapping

MakeMapping creates a new Mapping.

func (Mapping) Get

func (m Mapping) Get(url string) (Endpoint, bool)

Mapping finds an endpoint based on a URL and HTTP method pair.

type Table

type Table map[string]Endpoint

Table maps URLs to Endpoints.

Jump to

Keyboard shortcuts

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