api

package
v0.0.0-...-d9b7cdc Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRouter

func CreateRouter(gatewayHandler http.HandlerFunc) (http.Handler, error)

CreateRouter creates a new Router / Mux / http.Handler to route all traffic to the proper handlers

Types

type API

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

func New

func New(db *db.DB) *API

func (*API) DistrictsGet

func (s *API) DistrictsGet(ctx context.Context, request *pb.DistrictsGetRequest) (*pb.DistrictsGetResponse, error)

GetAllDistricts retrieves all districts or one by ID

func (*API) NationalForestsGet

func (s *API) NationalForestsGet(ctx context.Context, request *pb.NationalForestsGetRequest) (*pb.NationalForestsGetResponse, error)

NationalForestsGet retrieves all national forests or one by ID

func (*API) SiteUpsert

func (s *API) SiteUpsert(ctx context.Context, request *pb.SiteUpsertRequest) (*pb.SiteUpsertResponse, error)

SiteUpsert creates or updates a site in the database

func (*API) SitesGet

func (s *API) SitesGet(ctx context.Context, request *pb.SitesGetRequest) (*pb.SitesGetResponse, error)

SitesGet retrieves all sites and or one by ID

Jump to

Keyboard shortcuts

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