stacapi package - github.com/duckontheweb/go-stac-api/stacapi - Go Packages

stacapi

package
v0.0.0-...-896e2cd Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ListCollectionsPath = "/collections"
	GetCollectionPath   = "/collections/:id"
)
View Source
const (
	RootPath        = "/"
	ServiceDescPath = "/api"
	ServiceDocPath  = "/api.html"
)
View Source
const (
	ApplicationJSONType = "application/json"
	OpenAPIYAMLType     = "application/x-yaml"
	HTMLType            = "text/html"
)
View Source
const (
	SelfRel        = "self"
	RootRel        = "root"
	ParentRel      = "parent"
	ServiceDescRel = "service-desc"
	ServiceDocRel  = "service-doc"
	DataRel        = "data"
)
View Source
const APIVersion = "0.1.0"
View Source
const STACVersion = "1.1.0"
View Source
const StacCollectionsConformanceURI = "https://api.stacspec.org/v1.0.0/collections"
View Source
const StacCoreConformanceURI = "https://api.stacspec.org/v1.0.0/core"

Variables

This section is empty.

Functions

func RegisterBackend

func RegisterBackend(name string, backend Backend)

Types

type Api

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

func NewApi

func NewApi(config ApiConfig) Api

func (*Api) AddConformance

func (api *Api) AddConformance(stac_router IStacConformance)

func (*Api) AddToRouter

func (api *Api) AddToRouter(gr gin.IRouter)

func (*Api) ConformsTo

func (api *Api) ConformsTo() []string
func (api *Api) LandingPageLinks(request *http.Request) []*stac.Link

func (Api) Shutdown

func (api Api) Shutdown() error

type ApiConfig

type ApiConfig struct {
	Backend BackendConfig `yaml:"backend"`
}

func ReadConfig

func ReadConfig(config_path string) ApiConfig

type Backend

type Backend interface {
	GetClient(config BackendConfig) (BackendClient, error)
}

type BackendClient

type BackendClient interface {
	Close() error
}

type BackendConfig

type BackendConfig struct {
	Type             string `yaml:"type"`
	ConnectionString string `yaml:"connection_string"`
}

type CollectionNotFoundError

type CollectionNotFoundError struct {
	Id string
}

func (CollectionNotFoundError) Error

func (e CollectionNotFoundError) Error() string

type GetCollectionRequest

type GetCollectionRequest struct {
	Id string `path:"id" uri:"id" required:"true"`
}

type ICollectionsBackend

type ICollectionsBackend interface {
	ListCollections() []map[string]any
	GetCollection(id string) (map[string]any, error)
}

type IStacConformance

type IStacConformance interface {
	AttachHandlers(router ginopenapi.Generator)
	ConformanceClasses() []string
	LandingPageLinks(request *http.Request) []*stac.Link
}

type StacCollectionsConformance

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

func NewStacCollectionsConformance

func NewStacCollectionsConformance(backend ICollectionsBackend) StacCollectionsConformance

func (StacCollectionsConformance) AttachHandlers

func (r StacCollectionsConformance) AttachHandlers(router ginopenapi.Generator)

func (*StacCollectionsConformance) AttachTo

func (r *StacCollectionsConformance) AttachTo(api *Api)

func (StacCollectionsConformance) ConformanceClasses

func (r StacCollectionsConformance) ConformanceClasses() []string

func (StacCollectionsConformance) HandleGetCollection

func (r StacCollectionsConformance) HandleGetCollection(c *gin.Context)

func (StacCollectionsConformance) HandleListCollections

func (r StacCollectionsConformance) HandleListCollections(c *gin.Context)
func (r StacCollectionsConformance) LandingPageLinks(request *http.Request) []*stac.Link

type StacCoreConformance

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

func (StacCoreConformance) AttachHandlers

func (r StacCoreConformance) AttachHandlers(router ginopenapi.Generator)

func (*StacCoreConformance) AttachTo

func (r *StacCoreConformance) AttachTo(api *Api)

func (StacCoreConformance) ConformanceClasses

func (r StacCoreConformance) ConformanceClasses() []string

func (StacCoreConformance) HandleLandingPage

func (r StacCoreConformance) HandleLandingPage(c *gin.Context)
func (r StacCoreConformance) LandingPageLinks(request *http.Request) []*stac.Link

Jump to

Keyboard shortcuts

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