Documentation
¶
Index ¶
- Variables
- func AttachController(ctx context.Context, c *Controller) context.Context
- func Echo(e *echo.Group)
- func PublicApiAsset() echo.HandlerFunc
- func PublicApiItemOrAsset() echo.HandlerFunc
- func PublicApiItemOrAssetList() echo.HandlerFunc
- type Asset
- type Controller
- func (c *Controller) GetAsset(ctx context.Context, prj, i string) (Asset, error)
- func (c *Controller) GetAssets(ctx context.Context, pKey string, p ListParam) (ListResult[Asset], error)
- func (c *Controller) GetItem(ctx context.Context, prj, mkey, i string) (Item, error)
- func (c *Controller) GetItems(ctx context.Context, prj, model string, p ListParam) (ListResult[Item], *schema.Schema, error)
- func (c *Controller) GetSchemaJSON(ctx context.Context, pKey, mKey string) (SchemaJSON, error)
- func (c *Controller) GetVersionedItems(ctx context.Context, prj, model string, p ListParam) (item.VersionedList, *schema.Schema, error)
- type Feature
- type FeatureCollection
- type FeatureCollectionType
- type FeatureType
- type GeoJSON
- type Geometry
- type GeometryCollection
- type GeometryCollectionType
- type GeometryType
- type Geometry_Coordinates
- func (t Geometry_Coordinates) AsLineString() (LineString, error)
- func (t Geometry_Coordinates) AsMultiLineString() (MultiLineString, error)
- func (t Geometry_Coordinates) AsMultiPoint() (MultiPoint, error)
- func (t Geometry_Coordinates) AsMultiPolygon() (MultiPolygon, error)
- func (t Geometry_Coordinates) AsPoint() (Point, error)
- func (t Geometry_Coordinates) AsPolygon() (Polygon, error)
- func (t Geometry_Coordinates) MarshalJSON() ([]byte, error)
- func (t *Geometry_Coordinates) UnmarshalJSON(b []byte) error
- type Item
- type ItemAsset
- type ItemFields
- type LineString
- type ListParam
- type ListResult
- type MultiLineString
- type MultiPoint
- type MultiPolygon
- type Point
- type Polygon
- type SchemaJSON
- type SchemaJSONProperties
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidProject = rerror.NewE(i18n.T("invalid project"))
Functions ¶
func AttachController ¶
func AttachController(ctx context.Context, c *Controller) context.Context
func PublicApiAsset ¶
func PublicApiAsset() echo.HandlerFunc
func PublicApiItemOrAsset ¶
func PublicApiItemOrAsset() echo.HandlerFunc
func PublicApiItemOrAssetList ¶
func PublicApiItemOrAssetList() echo.HandlerFunc
Types ¶
type Asset ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func GetController ¶
func GetController(ctx context.Context) *Controller
func NewController ¶
func NewController(project repo.Project, usecases *interfaces.Container, aur asset.URLResolver) *Controller
func (*Controller) GetAssets ¶
func (c *Controller) GetAssets(ctx context.Context, pKey string, p ListParam) (ListResult[Asset], error)
func (*Controller) GetItems ¶
func (c *Controller) GetItems(ctx context.Context, prj, model string, p ListParam) (ListResult[Item], *schema.Schema, error)
func (*Controller) GetSchemaJSON ¶
func (c *Controller) GetSchemaJSON(ctx context.Context, pKey, mKey string) (SchemaJSON, error)
func (*Controller) GetVersionedItems ¶
func (c *Controller) GetVersionedItems(ctx context.Context, prj, model string, p ListParam) (item.VersionedList, *schema.Schema, error)
type Feature ¶
type Feature struct { Geometry *Geometry `json:"geometry,omitempty"` Id *string `json:"id,omitempty"` Properties *orderedmap.OrderedMap `json:"properties,omitempty"` Type *FeatureType `json:"type,omitempty"` }
type FeatureCollection ¶
type FeatureCollection struct { Features *[]Feature `json:"features,omitempty"` Type *FeatureCollectionType `json:"type,omitempty"` }
type FeatureCollectionType ¶
type FeatureCollectionType string
const FeatureCollectionTypeFeatureCollection FeatureCollectionType = "FeatureCollection"
type Geometry ¶
type Geometry struct { Coordinates *Geometry_Coordinates `json:"coordinates,omitempty"` Geometries *[]Geometry `json:"geometries,omitempty"` Type *GeometryType `json:"type,omitempty"` }
type GeometryCollection ¶
type GeometryCollection struct { Geometries *[]Geometry `json:"geometries,omitempty"` Type *GeometryCollectionType `json:"type,omitempty"` }
type GeometryCollectionType ¶
type GeometryCollectionType string
const GeometryCollectionTypeGeometryCollection GeometryCollectionType = "GeometryCollection"
type GeometryType ¶
type GeometryType string
const ( GeometryTypeGeometryCollection GeometryType = "GeometryCollection" GeometryTypeLineString GeometryType = "LineString" GeometryTypeMultiLineString GeometryType = "MultiLineString" GeometryTypeMultiPoint GeometryType = "MultiPoint" GeometryTypeMultiPolygon GeometryType = "MultiPolygon" GeometryTypePoint GeometryType = "Point" GeometryTypePolygon GeometryType = "Polygon" )
type Geometry_Coordinates ¶
type Geometry_Coordinates struct {
// contains filtered or unexported fields
}
func (Geometry_Coordinates) AsLineString ¶
func (t Geometry_Coordinates) AsLineString() (LineString, error)
func (Geometry_Coordinates) AsMultiLineString ¶
func (t Geometry_Coordinates) AsMultiLineString() (MultiLineString, error)
func (Geometry_Coordinates) AsMultiPoint ¶
func (t Geometry_Coordinates) AsMultiPoint() (MultiPoint, error)
func (Geometry_Coordinates) AsMultiPolygon ¶
func (t Geometry_Coordinates) AsMultiPolygon() (MultiPolygon, error)
func (Geometry_Coordinates) AsPoint ¶
func (t Geometry_Coordinates) AsPoint() (Point, error)
func (Geometry_Coordinates) AsPolygon ¶
func (t Geometry_Coordinates) AsPolygon() (Polygon, error)
func (Geometry_Coordinates) MarshalJSON ¶
func (t Geometry_Coordinates) MarshalJSON() ([]byte, error)
func (*Geometry_Coordinates) UnmarshalJSON ¶
func (t *Geometry_Coordinates) UnmarshalJSON(b []byte) error
type Item ¶
type Item struct { ID string Fields ItemFields }
func (Item) MarshalJSON ¶
type ItemAsset ¶
type ItemAsset struct { Type string `json:"type"` ID string `json:"id,omitempty"` URL string `json:"url,omitempty"` }
func NewItemAsset ¶
func NewItemAsset(a *asset.Asset, urlResolver asset.URLResolver) ItemAsset
type ItemFields ¶
func NewItemFields ¶
func (ItemFields) DropEmptyFields ¶
func (i ItemFields) DropEmptyFields() ItemFields
type LineString ¶
type LineString = []Point
type ListParam ¶
type ListParam struct {
Pagination *usecasex.Pagination
}
type ListResult ¶
type ListResult[T any] struct { Results []T `json:"results"` TotalCount int64 `json:"totalCount"` HasMore *bool `json:"hasMore,omitempty"` // offset base Limit *int64 `json:"limit,omitempty"` Offset *int64 `json:"offset,omitempty"` Page *int64 `json:"page,omitempty"` // cursor base NextCursor *string `json:"nextCursor,omitempty"` }
func NewListResult ¶
func NewListResult[T any](results []T, pi *usecasex.PageInfo, p *usecasex.Pagination) ListResult[T]
type MultiLineString ¶
type MultiLineString = []LineString
type MultiPoint ¶
type MultiPoint = []Point
type MultiPolygon ¶
type MultiPolygon = []Polygon
type SchemaJSON ¶
type SchemaJSONProperties ¶
type SchemaJSONProperties struct { Description *string `json:"description,omitempty"` Format *string `json:"format,omitempty"` Items *SchemaJSON `json:"items,omitempty"` MaxLength *int `json:"maxLength,omitempty"` Maximum *float64 `json:"maximum,omitempty"` Minimum *float64 `json:"minimum,omitempty"` Title *string `json:"title,omitempty"` Type string `json:"type"` }
Click to show internal directories.
Click to hide internal directories.