gds

package
v0.0.0-...-4788987 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: Apache-2.0 Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEntityNotFound = errors.New("queried entity not found")

Functions

This section is empty.

Types

type Client

type Client struct {
	*datastore.Client
}

func NewDatastoreClient

func NewDatastoreClient(projectID string, database *string) (*Client, error)

NewDatastoreClient returns a Client for the Google Datastore service.

func (*Client) GetWebFeatureMetadata

func (c *Client) GetWebFeatureMetadata(ctx context.Context, webFeatureID string) (*FeatureMetadata, error)

GetWebFeatureMetadata atttempts to get data for a given web feature.

func (*Client) UpsertFeatureMetadata

func (c *Client) UpsertFeatureMetadata(
	ctx context.Context,
	data FeatureMetadata,
) error

UpsertFeatureMetadata inserts/updates metadata for the given web feature.

type FeatureMetadata

type FeatureMetadata struct {
	// The ID from WebFeatures table in spanner. Not the web features key.
	WebFeatureID string `datastore:"web_feature_id"`
	// Non-null fields from https://github.com/web-platform-dx/web-features/blob/main/schemas/data.schema.json
	Description string `datastore:"description"`
	// Nullable fields from https://github.com/web-platform-dx/web-features/blob/main/schemas/data.schema.json
	CanIUseIDs []string `datastore:"can_i_use_ids"`
}

FeatureMetadata contains useful metadata about the feature. This information is not stored in the relational database because it is not used in complex queries for the overview page.

type Filterable

type Filterable interface {
	FilterQuery(*datastore.Query) *datastore.Query
}

Filterable modifies a query with a given filter.

type Mergeable

type Mergeable[T any] interface {
	Merge(existing *T, incoming *T) *T
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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