handler

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	PublicAPI  *pb.PublicAPI
	ExploreAPI *pb.ExploreAPI
}

The API consisting of the public api def and the summary explore api info

type APIEntry

type APIEntry struct {
	ID           string
	Name         string
	Description  string
	OpenAPIJSON  string
	Pricing      map[string]int64 // pricing mapping endpoints to price in 1/100 of a cent
	OwnerID      string
	ExamplesJSON string
	Category     string
	Icon         string
	PostmanJSON  string
	DisplayName  string
	Quotas       map[string]int64 // mapping endpoints to their free quotas
}

type Explore

type Explore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewExploreAPIHandler

func NewExploreAPIHandler(srv *service.Service) *Explore

func (*Explore) API

func (e *Explore) API(ctx context.Context, request *pb.APIRequest, response *pb.APIResponse) error

API returns a single named API entry

func (*Explore) Index

func (e *Explore) Index(ctx context.Context, request *pb.IndexRequest, response *pb.IndexResponse) error

Index returns a summary description of all the apis

func (*Explore) ListCategories

func (e *Explore) ListCategories(ctx context.Context, request *pb.ListCategoriesRequest, response *pb.ListCategoriesResponse) error

func (*Explore) Pricing

func (e *Explore) Pricing(ctx context.Context, request *pb.PricingRequest, response *pb.PricingResponse) error

func (*Explore) Search

func (e *Explore) Search(ctx context.Context, request *pb.SearchRequest, response *pb.SearchResponse) error

Search returns APIs based on the given search term

type Publicapi

type Publicapi struct {
}

func NewPublicAPIHandler

func NewPublicAPIHandler(srv *service.Service) *Publicapi

func (*Publicapi) Get

func (p *Publicapi) Get(ctx context.Context, request *pb.GetRequest, response *pb.GetResponse) error

func (*Publicapi) List

func (p *Publicapi) List(ctx context.Context, request *pb.ListRequest, response *pb.ListResponse) error

func (*Publicapi) Publish

func (p *Publicapi) Publish(ctx context.Context, request *pb.PublishRequest, response *pb.PublishResponse) error

func (*Publicapi) Remove

func (p *Publicapi) Remove(ctx context.Context, request *pb.RemoveRequest, response *pb.RemoveResponse) error

func (*Publicapi) Update

func (p *Publicapi) Update(ctx context.Context, request *pb.UpdateRequest, response *pb.UpdateResponse) error

type SearchCount

type SearchCount struct {
	// search term itself
	Id    string `json:"id"`
	Count int64  `json:"count"`
}

Jump to

Keyboard shortcuts

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