mirror of
https://github.com/johndoe6345789/goodpackagerepo.git
synced 2026-04-24 13:54:59 +00:00
2.8 KiB
2.8 KiB
Templates
This directory contains template files for creating new entities, routes, and configurations in the goodpackagerepo system.
Contents
entity_template.json- Template for defining new entity typesroute_template.json- Template for creating new API routespipeline_template.json- Template for building operation pipelinesblob_store_template.json- Template for configuring blob storesauth_scope_template.json- Template for defining authentication scopesupstream_template.json- Template for configuring upstream repositories
Operation Vocabulary
The repository supports a closed-world set of operations that can be used in pipeline definitions:
Authentication Operations
auth.require_scopes- Require specific scopes for access
Parsing Operations
parse.path- Parse path parameters into entity fieldsparse.query- Parse query parametersparse.json- Parse JSON request body
Normalization and Validation
normalize.entity- Normalize entity fields (trim, lowercase, etc.)validate.entity- Validate entity against constraintsvalidate.json_schema- Validate data against JSON schema
Transaction Operations
txn.begin- Begin a transactiontxn.commit- Commit a transactiontxn.abort- Abort a transaction
Key-Value Store Operations
kv.get- Get value from KV storekv.put- Put value into KV storekv.cas_put- Compare-and-swap put (conditional)kv.delete- Delete from KV store
Blob Store Operations
blob.get- Get blob from storeblob.put- Put blob into storeblob.verify_digest- Verify blob integrity
Index Operations
index.query- Query an indexindex.upsert- Insert or update index entryindex.delete- Delete from index
Cache Operations
cache.get- Get from cachecache.put- Put into cache
Proxy Operations
proxy.fetch- Fetch from upstream proxy
Response Operations
respond.json- Return JSON responserespond.bytes- Return binary responserespond.redirect- Return redirect responserespond.error- Return error response
Event Operations
emit.event- Emit an event to the event log
Utility Operations
time.now_iso8601- Get current time in ISO8601 formatstring.format- Format strings with variables
Usage
Copy a template file and customize it for your needs. Templates use placeholders that should be replaced:
{namespace}- Package namespace{name}- Package name{version}- Package version{variant}- Package variant$variable- Runtime variable from pipeline execution
Example
To create a new route based on a template:
cp templates/route_template.json my_route.json
# Edit my_route.json with your route definition
# Use the admin API to add the route to the system