Documentation
¶
Overview ¶
Package gst defines the public contracts between the framework and business projects: the Model, Service, Database, Selector, Cache, RBAC, and Logger interfaces, the query building blocks they exchange (Filter, Order, Cursor, Column, Term, Window), the per-request ServiceContext, the streams the service of a Stream action reads and writes, and the Error a request is answered with.
Index ¶
- Constants
- Variables
- func RequestUserID(ctx context.Context) string
- type AnyColumnRef
- type Assignment
- type BidiStream
- type Bound
- type Cache
- type ClientStream
- type Column
- type ColumnRef
- type ControllerConfig
- type Cursor
- type Database
- type DatabaseOption
- type DateColumn
- type Decision
- type Error
- type Expr
- type Filter
- type FilterOp
- type JSONStringsColumn
- type JoinSource
- type Logger
- type Model
- type Module
- type NumericColumn
- type Operation
- type Order
- type Ordering
- type Permission
- type QueryOptions
- type RBAC
- type Request
- type Response
- type SQLStatement
- type SelectBranch
- type Selector
- type ServerStream
- type Service
- type ServiceContext
- type TableNamer
- type Term
- type TermCondition
- type TermOrder
- type TimeColumn
- type Union
- type Window
Constants ¶
const ( OperationCreate = gst.OperationCreate OperationDelete = gst.OperationDelete OperationUpdate = gst.OperationUpdate OperationPatch = gst.OperationPatch OperationList = gst.OperationList OperationGet = gst.OperationGet OperationExport = gst.OperationExport OperationImport = gst.OperationImport OperationCreateMany = gst.OperationCreateMany OperationDeleteMany = gst.OperationDeleteMany OperationUpdateMany = gst.OperationUpdateMany OperationPatchMany = gst.OperationPatchMany )
The operations an operation log records.
const ( FilterOpEq = gst.FilterOpEq // equal: column = value FilterOpNe = gst.FilterOpNe // not equal: column <> value FilterOpGt = gst.FilterOpGt // greater than: column > value FilterOpGte = gst.FilterOpGte // greater than or equal: column >= value FilterOpLt = gst.FilterOpLt // less than: column < value FilterOpLte = gst.FilterOpLte // less than or equal: column <= value FilterOpIn = gst.FilterOpIn // set membership: column IN (comma-separated values) FilterOpNotIn = gst.FilterOpNotIn // set exclusion: column NOT IN (comma-separated values) FilterOpLike = gst.FilterOpLike // substring match: column LIKE %value% FilterOpNotLike = gst.FilterOpNotLike // substring exclusion: column NOT LIKE %value% FilterOpILike = gst.FilterOpILike // substring match whatever the case of the letters a to z: LOWER(column) LIKE LOWER(%value%) FilterOpStartsWith = gst.FilterOpStartsWith // prefix match: column LIKE value% (can use an index) FilterOpEndsWith = gst.FilterOpEndsWith // suffix match: column LIKE %value FilterOpIsNull = gst.FilterOpIsNull // null check: value true means IS NULL, false means IS NOT NULL )
URL-exposed operators, which a request spells as "field[op]=value".
const ( FilterOpRegex = gst.FilterOpRegex // regular expression match: column REGEXP value (dialect-aware) FilterOpNotRegex = gst.FilterOpNotRegex // regular expression exclusion: NOT (column REGEXP value) FilterOpJSONContains = gst.FilterOpJSONContains // JSON array membership: value is a member of the JSON array column FilterOpOr = gst.FilterOpOr // group: the []Filter value is OR-combined, the group itself AND-combined FilterOpAnd = gst.FilterOpAnd // group: the []Filter value is AND-combined, for nesting inside an OR group FilterOpExists = gst.FilterOpExists // correlated subquery: EXISTS or NOT EXISTS over a related model FilterOpEqCol = gst.FilterOpEqCol // column equals another column: the enclosing query's inside a subquery, a table read beside it inside a join FilterOpFalse = gst.FilterOpFalse // constant predicate: matches nothing, see FilterFalse )
Service-only operators, which service code builds and no request can spell.
const ( QueryExpand = gst.QueryExpand QueryFormat = gst.QueryFormat )
The framework-owned URL query parameters a project reads itself: the expansion a Get applies and the format an Export writes. Framework parameters all live in the "_" prefix namespace, so bare query keys always belong to model filter fields.
const DefaultCountAlias = gst.DefaultCountAlias
DefaultCountAlias is the alias COUNT(*) projects under when the caller does not rename it. A column term defaults to its column name, but COUNT(*) names no column, so without a default of its own it would be the one term that always had to be renamed.
const FrameworkName = gst.FrameworkName
FrameworkName is the name of the framework, gst: the name generated code and the logs spell it by, the User-Agent of the client, the issuer of the tokens, and the default of the application, service and namespace names the configuration takes.
Variables ¶
var ( // NewError creates the error a request is answered with: status and a // client-safe message. // // The status must be a 4xx or 5xx HTTP status code. Invalid statuses, including // 2xx/3xx success or redirect statuses such as http.StatusOK, are normalized to // http.StatusInternalServerError and the provided message is discarded. NewError = gst.NewError // NewErrorWithCause creates the error a request is answered with, carrying // an internal cause. // // The status must be a 4xx or 5xx HTTP status code. Invalid statuses, including // 2xx/3xx success or redirect statuses such as http.StatusOK, are normalized to // http.StatusInternalServerError and the provided message is discarded. // // The cause is reported by Error for logs and available through Unwrap, but // is never exposed as the response message. NewErrorWithCause = gst.NewErrorWithCause )
The constructors are forwarded as variables instead of wrapper functions on purpose: a wrapper function would add its own frame on top of the stack trace captured at the construction site.
var ErrEntryNotFound = gst.ErrEntryNotFound
ErrEntryNotFound is returned when a cache entry is not found, or when the stored value cannot be decoded as the handle's type and the entry is dropped.
var ErrTTLNotSupported = gst.ErrTTLNotSupported
ErrTTLNotSupported is returned by Cache.Set when the backend cannot honor the requested ttl semantics, such as a per-entry lifetime on a backend without per-entry expiration.
Functions ¶
func RequestUserID ¶
RequestUserID reports the authenticated subject of the request ctx descends from, or "" when no request is behind it.
Types ¶
type AnyColumnRef ¶
type AnyColumnRef = gst.AnyColumnRef
AnyColumnRef is the type-erased view of every generated column reference, for options that take a heterogeneous column list: WithSelect accepts columns of different Go types in one call, which the parameterized ColumnRef cannot express. The unexported method keeps the set of implementations closed to the framework, so a stray type that happens to carry a Name method cannot slip into a column list.
type Assignment ¶
type Assignment = gst.Assignment
Assignment is one column-value write, the unit UpdateByID accepts. Service code builds assignments through the generated column references (SampleCols.Status.Set(v)), whose typed front end stops a wrong-typed value or a misspelled column at compile time; generic code assigns through a reference minted for its type parameter. Its fields are unexported, so those references are the only way to build one; Table, Column and Value read it back.
type BidiStream ¶
type BidiStream[REQ Request, RSP Response] = gst.BidiStream[REQ, RSP]
BidiStream is the request and response stream of a Stream action declaring both a StreamingPayload and a StreamingResult: Recv and Send as on the two above, independent of each other.
type Bound ¶
Bound is one end of the range a column's comparison filters confine it to: the value at that end, whether the range includes it, and whether any filter gave that end at all. An absent end leaves the range open on that side.
type ClientStream ¶
type ClientStream[REQ Request] = gst.ClientStream[REQ]
ClientStream is the request stream of a Stream action declaring a StreamingPayload: the service's Stream method reads each request through Recv, which answers io.EOF once the client finished sending.
type Column ¶
Column is a typed reference to a database column, generated per model by gg gen. T is the Go type of the column, so a filter built through a Column cannot name a column that does not exist nor bind a value of the wrong type: both mistakes stop at compile time instead of surfacing as a SQL error or a silently wrong result set.
func NewColumn ¶
func NewColumn[M TableNamer, T any](name string) Column[T]
NewColumn returns a typed reference to the named column of M's table. gg gen emits the calls in each model's generated file, naming the model as the first type argument, so the table comes from the model's own TableName and is never restated as a literal. Handwritten code, model hooks included, reads those generated Cols vars; gg check flags project code that mints a reference instead, with two exceptions. Generic code has no concrete model and so no Cols var: it names its type parameter as the model, and NewColumn[M, string]("id").In(ids...) keeps the value type checked where a plain column name would not. Module sources have no generated file and name their model the way gg gen does. The fields are unexported so a shared reference cannot be repointed at another column after construction.
type ColumnRef ¶
ColumnRef is the shared typed view of every generated column reference. Helpers that accept a column take this interface rather than a concrete struct, because embedding is not subtyping in Go: NumericColumn[T] cannot be passed where Column[T] is expected, so a helper typed on the struct would reject exactly the numeric and time columns it is most often used with.
type ControllerConfig ¶
type ControllerConfig[M Model] = gst.ControllerConfig[M]
ControllerConfig customizes how router.Register builds an internal handler for a route. It is the public configuration surface for controller behavior; the concrete controller handlers and their runtime state remain framework-owned.
type Cursor ¶
Cursor is where a cursor-paginated read starts and which way it goes: the feed's stable ordering, the boundary row, and whether the read travels along that ordering or back down it. Its fields are unexported, so a cursor comes from CursorForward, CursorBackward or the framework's URL parsing; Order, Value, Backward and Bounded read it back. The cursor orders the feed on every page, the first one included.
func CursorBackward ¶
CursorBackward pages against order, starting just before value, or at the feed's last row when value is empty.
func CursorForward ¶
CursorForward pages along order, starting just past value, or at the feed's first row when value is empty.
type Database ¶
Database defines the model-scoped database operation contract. It provides CRUD operations, query builders, and optional dry-run behavior for a single Model type.
type DatabaseOption ¶
type DatabaseOption[M Model] = gst.DatabaseOption[M]
DatabaseOption provides chainable options for a single Database operation chain. Options apply to the next terminal operation and are reset afterward. Start a new chain with database.Database[M](ctx) for each independent operation.
type DateColumn ¶
type DateColumn = gst.DateColumn
DateColumn is the reference generated for a column holding a calendar day, a Date: its filters take the day itself, where a TimeColumn takes an instant. It embeds Column and adds the bucketing a day carries, by day and by month.
func NewDateColumn ¶
func NewDateColumn[M TableNamer](name string) DateColumn
NewDateColumn returns the date reference to the named column of M's table, carrying the bucketing group keys on top of everything Column has.
type Error ¶
Error is the error a request is answered with: a status and a client-safe message, with an internal cause for the logs. A service method, a model hook, a middleware or an interceptor returns it to refuse a request with a status of its own; any other error is the server's failure, answered 500.
type Expr ¶
Expr is what a projection selects and a window partitions by: a column reference, projected as it is stored, or a Term. The set is closed to the framework, so a projection can never carry SQL text.
type Filter ¶
Filter is one field-level filter to apply as an AND condition: the column it compares, the table that column belongs to, the operator and the value. Its fields are unexported, so a filter comes from the generated column references, a reference minted for a type parameter, the grouping, subquery and constant constructors below, or the framework's URL parsing. Table, Column, Op and Value read it back; Split, Values, ExcludedValues and Bounds on a column reference read one column's filters converted to the column's type. A filter carrying another table is applied to that table when the query joins it and fails the query otherwise, and the value is always bound as a statement parameter.
func FilterAnd ¶
FilterAnd groups filters that are AND-combined with each other. Filters are already AND-combined at the top level, so the group exists to nest an AND inside an OR group.
func FilterExists ¶
FilterExists matches rows of the queried model that have at least one related row in C satisfying filters. EqCol predicates tie the related rows to the queried row, one per column pair, next to the ordinary conditions narrowing them.
func FilterFalse ¶
func FilterFalse() Filter
FilterFalse matches nothing. It is the condition a permission hook returns when the caller may see no row at all. Unlike an empty filter list it is a real condition, so it disables the empty-query safety check; unlike a filter the renderer cannot apply it is deliberate, so nothing is logged. It renders as 1 = 0 on every dialect and composes like any other filter, inside groups, subqueries and conditional measures included.
func FilterNotExists ¶
FilterNotExists matches rows that have no related row in C satisfying filters. Note that it is not the negation of a filtered FilterExists over the same rows: a row whose related rows all fail filters matches, and so does a row with no related rows at all. A subquery without any EqCol predicate fails the query here as well, so that negating "match nothing" cannot widen it into "match everything".
type FilterOp ¶
FilterOp is a field-level filter operator: the comparison a Filter applies, which Filter.Op reads back. Operators never widen a query: unknown values are rejected during parsing, and the database layer never drops a condition it cannot apply, narrowing the query to an empty result on one of a URL-exposed operator and failing it on one of a service-only operator, which no client can have sent.
type JSONStringsColumn ¶
type JSONStringsColumn = gst.JSONStringsColumn
JSONStringsColumn is the reference generated for a column storing a JSON array of strings. It embeds Column over datatypes.JSONSlice[string], the type that binds such an array as a JSON document, and adds the membership test, which only such a column answers alike on every dialect.
func NewJSONStringsColumn ¶
func NewJSONStringsColumn[M TableNamer](name string) JSONStringsColumn
NewJSONStringsColumn returns the reference to the named column of M's table storing a JSON array of strings, carrying JSONContains on top of everything Column has.
type JoinSource ¶
type JoinSource = gst.JoinSource
JoinSource is a source a select joins to its model. The set is closed to the framework: Join and LeftJoin join a model on a unique key, JoinSelect and LeftJoinSelect join a grouped select on its group keys.
func Join ¶
func Join[C Model](on ...Filter) JoinSource
Join joins model C on a unique key: JOIN, keeping only the rows of the query that match a row of C. The predicates are the ON condition.
func JoinSelect ¶
func JoinSelect[R any](sub SelectBranch[R], on ...Filter) JoinSource
JoinSelect joins a grouped select as a derived table, JOIN (SELECT ...) AS jN ON ..., keeping only the rows of the query that match one of its groups. This is how a one-to-many relation is read beside its one side: the many side is grouped by the key first, so every key has one row, and that row is joined.
func LeftJoin ¶
func LeftJoin[C Model](on ...Filter) JoinSource
LeftJoin joins model C on a unique key, keeping the rows of the query that match no row of C with the joined columns NULL: LEFT JOIN. The rules match Join; the result fields the joined columns bind to must hold NULL.
func LeftJoinSelect ¶
func LeftJoinSelect[R any](sub SelectBranch[R], on ...Filter) JoinSource
LeftJoinSelect joins a grouped select as a derived table, keeping the rows of the query that match none of its groups with the select's terms NULL: LEFT JOIN. The rules match JoinSelect; the result fields the select's terms bind to must hold NULL.
type Logger ¶
Logger is the logger the framework hands to services and modules and keeps in the logger package's streams. It writes an entry plain and printf-style, sugared with key/value fields (the "w" methods) and with typed zap.Field values (the "z" methods); With attaches string key/value fields and WithContext derives a logger carrying request metadata fields.
type Model ¶
Model defines the framework contract for database-backed and action models. Typical database resources embed model.Base (UUIDv7 string primary key) or model.AutoBase (auto-increment integer primary key). Action-only models may use model.Empty when they do not represent persistent rows.
type Module ¶
Module describes a registered API module: route metadata, auth exposure, resource parameter name, and the service implementation used by controllers.
type NumericColumn ¶
type NumericColumn[T any] = gst.NumericColumn[T]
NumericColumn is the reference generated for a column whose Go type is numeric. It embeds Column, so every filter and order stays available, and adds the aggregate functions that only make sense over a number.
func NewNumericColumn ¶
func NewNumericColumn[M TableNamer, T any](name string) NumericColumn[T]
NewNumericColumn returns the numeric reference to the named column of M's table, carrying Sum and Avg on top of everything Column has.
type Order ¶
Order is one ORDER BY term: a column and the direction to sort it by. Its fields are unexported, so an order comes from a generated column reference, a reference minted for a type parameter, or the framework's URL parsing; Table, Column and Descending read it back, and SortsBy tells whether it sorts by a given column. Table is filled in by a column reference and left empty by URL parsing. The chain's reads and a select check it: a select that joins tells two tables' columns of one name apart by it, and a chain refuses an order of another model. A union orders its result columns by name and reads no table, and WithExpand orders the associated table, so neither checks it. An Order with an empty column is skipped rather than rendered.
type Ordering ¶
Ordering is what the OrderBy methods of a select, a window and a union accept: an Order sorting by a column reference, or a TermOrder sorting by a projection term. The set is closed, so an ordering can never carry SQL the way a free-form string could.
type Permission ¶
type Permission = gst.Permission
Permission is one operation a role is allowed to perform on one object. It is the unit the whole-set replacement methods on RBAC take, so a caller states a role's permissions as a set rather than as a sequence of grants.
type QueryOptions ¶
type QueryOptions = gst.QueryOptions
QueryOptions tunes how WithQuery turns a model value into WHERE conditions. Every condition it produces is AND-combined; the zero value means exact matching with the empty-query safety check enabled. See the WithQuery method for usage examples.
type RBAC ¶
RBAC provides tenant-scoped role, permission, and subject assignment operations. A process holding no policy set — RBAC disabled, or not initialized — answers reads as the deployment they describe, denying every request and reporting no roles, and refuses every write rather than reporting a change it did not make.
type Request ¶
Request and Response are the framework-facing types of one action's request and response payloads. They constrain the REQ and RSP type parameters of Service and Module; the concrete types are declared per action by the model layer.
type Response ¶
Request and Response are the framework-facing types of one action's request and response payloads. They constrain the REQ and RSP type parameters of Service and Module; the concrete types are declared per action by the model layer.
type SQLStatement ¶
type SQLStatement = gst.SQLStatement
SQLStatement contains a generated SQL statement in executable and rendered forms.
type SelectBranch ¶
type SelectBranch[R any] = gst.SelectBranch[R]
SelectBranch is a select in the role of a branch of a union: every Selector is one, with its model type erased, so that selects over different models stack into one result as long as they scan into the same row type. The role is what UnionAll takes. Only the selects the database layer builds can fill it; UnionAll fails when handed anything else, a union among them.
type Selector ¶
Selector runs an analytical read over the table of M and scans the result rows into R. It is deliberately separate from Database[M]: a projected row is not a model row, so model hooks, association preloading and cursor pagination have nothing to act on and are absent here rather than present and inert.
type ServerStream ¶
type ServerStream[RSP Response] = gst.ServerStream[RSP]
ServerStream is the response stream of a Stream action declaring a StreamingResult: the service's Stream method sends each response through Send, which fails once the client went away or the call was canceled.
type Service ¶
Service defines the controller-facing business operation contract for a model. Generated controllers call these methods for CRUD, batch CRUD, lifecycle hooks, import/export, filtering, and logging.
type ServiceContext ¶
type ServiceContext = gst.ServiceContext
ServiceContext is the per-request context the framework hands to every service method. It implements context.Context by delegating to the request context, exposes request metadata (route, params, user identity, trace), and carries the response helpers a service needs without touching Gin directly.
type TableNamer ¶
type TableNamer = gst.TableNamer
TableNamer is the one method a column reference needs from its model: the table the column belongs to. Every Model satisfies it; the narrower interface lets a reference name its model as a type argument alone, with nothing else of the model contract in play.
type Term ¶
Term is one term of a projection: a group key, a plain column, a constant, a measure, or a window function. Column references build it, as do Count, the ranking functions and Literal below.
func Count ¶
func Count() Term
Count counts rows: COUNT(*). It counts a row even when every column is NULL, which is what a plain row count means; use a column reference's Count for COUNT(column), which skips NULLs.
func Literal ¶
Literal projects a constant, which is how the branches of a union tell their rows apart.
func Rank ¶
func Rank() Term
Rank ranks the rows of each partition in the window's order. Rows sorting equal share a rank and the next rank skips past them: 1, 2, 2, 4.
func RowNumber ¶
func RowNumber() Term
RowNumber numbers the rows of each partition from 1 in the window's order, with no ties: two rows sorting equal still get consecutive numbers, in a stable order the framework completes with the primary key. Like Rank and DenseRank it only exists over a window whose OrderBy is set, which Over declares: without an order there is no first row to number.
type TermCondition ¶
type TermCondition = gst.TermCondition
TermCondition is one condition on a projected term: a Having condition on a measure, or a Qualify condition on a window function. It carries the term itself rather than an alias string, which has two consequences: a condition can never name a term the projection did not declare, and the renderer can emit the full expression instead of the alias, which HAVING requires because PostgreSQL does not accept an output alias there.
type TermOrder ¶
TermOrder is one ORDER BY term of a select or of a window. Unlike Order it sorts by a projection term, which is what a TopN report ranks by.
type TimeColumn ¶
type TimeColumn = gst.TimeColumn
TimeColumn is the reference generated for a column holding an instant, time.Time or a type holding one. It embeds Column and adds time bucketing, which is only meaningful over a time value and produces garbage rather than an error on some dialects when it is not.
func NewTimeColumn ¶
func NewTimeColumn[M TableNamer](name string) TimeColumn
NewTimeColumn returns the time reference to the named column of M's table, carrying the bucketing group keys on top of everything Column has.
type Union ¶
Union stacks the rows of several selects into one result: UNION ALL, the one set operation the framework offers. UNION proper would fold two rows that happen to be equal — two payments of the same amount on the same day — into one, which no report wants; INTERSECT and EXCEPT are the semi joins FilterExists and FilterNotExists already express.
type Window ¶
Window names the rows a window function reads for each row: PartitionBy splits the rows into partitions, and OrderBy orders each partition, which is what gives a running total its direction and a row number its sequence.
func OrderBy ¶
OrderBy returns a Window with no partition and the given orders: the window a ranking across every row reads. It is the short spelling of PartitionBy().OrderBy(orders...), the two building the same window; a window with keys starts from PartitionBy. It orders the window, not the result: the result is ordered by the Selector's OrderBy.
func PartitionBy ¶
PartitionBy opens a window partitioned by keys. Without keys the whole result is one partition, which is what a ranking over every row wants, and the window is the one OrderBy opens: the two spellings build the same value, so a term declared with one is found by the other.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package apidoc registers the doc comments the generated OpenAPI document describes a project's API with.
|
Package apidoc registers the doc comments the generated OpenAPI document describes a project's API with. |
|
Package authn exposes the authentication extension points that optional modules install into the mandatory IAM login flow.
|
Package authn exposes the authentication extension points that optional modules install into the mandatory IAM login flow. |
|
jwt
Package jwt issues and checks the tokens of a JWT login: GenTokens signs an access token and a refresh token for a user, ParseToken and Verify check the access token a request carries, and RefreshTokens trades a refresh token for a new pair.
|
Package jwt issues and checks the tokens of a JWT login: GenTokens signs an access token and a refresh token for a user, ParseToken and Verify check the access token a request carries, and RefreshTokens trades a refresh token for a new pair. |
|
authz
|
|
|
rbac
Package rbac decides authorization from stored policy rules and keeps those rules in step with the records they are derived from.
|
Package rbac decides authorization from stored policy rules and keeps those rules in step with the records they are derived from. |
|
Package bootstrap brings a gst process up and takes it down again.
|
Package bootstrap brings a gst process up and takes it down again. |
|
Package cache is the public facade of the framework's in-memory cache.
|
Package cache is the public facade of the framework's in-memory cache. |
|
Package client is the official HTTP client for gst backends, designed as the client-side pairing of the framework's DSL: every HTTP interface shape a model's Design() can declare has a first-class counterpart here.
|
Package client is the official HTTP client for gst backends, designed as the client-side pairing of the framework's DSL: every HTTP interface shape a model's Design() can declare has a first-class counterpart here. |
|
cmd
|
|
|
gg
command
Gg works on the gst project in the current directory: it generates the code the models declare, checks the project against the framework's conventions, and migrates the database to the models.
|
Gg works on the gst project in the current directory: it generates the code the models declare, checks the project against the framework's conventions, and migrates the database to the models. |
|
Package component runs a project's own long-running work alongside the server — a consumer loop, a poller, a watcher: work that runs on every replica for the life of the process.
|
Package component runs a project's own long-running work alongside the server — a consumer loop, a poller, a watcher: work that runs on every replica for the life of the process. |
|
Package config loads the application configuration: the framework's own sections, held by App, and the sections a project adds with Register.
|
Package config loads the application configuration: the framework's own sections, held by App, and the sections a project adds with Register. |
|
Package cronjob runs the jobs a project registers on a schedule.
|
Package cronjob runs the jobs a project registers on a schedule. |
|
Package database provides the framework database facade built on top of GORM.
|
Package database provides the framework database facade built on top of GORM. |
|
clickhouse
Package clickhouse is the ClickHouse dialect of the framework's database layer: Init opens the default connection when the configuration selects ClickHouse, and New opens a handle from a configuration of the caller's.
|
Package clickhouse is the ClickHouse dialect of the framework's database layer: Init opens the default connection when the configuration selects ClickHouse, and New opens a handle from a configuration of the caller's. |
|
mysql
Package mysql is the MySQL dialect of the framework's database layer: Init opens the default connection when the configuration selects MySQL, New opens a handle from a configuration of the caller's, and DryRun returns a handle that builds statements without connecting.
|
Package mysql is the MySQL dialect of the framework's database layer: Init opens the default connection when the configuration selects MySQL, New opens a handle from a configuration of the caller's, and DryRun returns a handle that builds statements without connecting. |
|
postgres
Package postgres is the PostgreSQL dialect of the framework's database layer: Init opens the default connection when the configuration selects PostgreSQL, and New opens a handle from a configuration of the caller's.
|
Package postgres is the PostgreSQL dialect of the framework's database layer: Init opens the default connection when the configuration selects PostgreSQL, and New opens a handle from a configuration of the caller's. |
|
sqlite
Package sqlite is the SQLite dialect of the framework's database layer: Init opens the default connection when the configuration selects SQLite, and New opens a handle from a configuration of the caller's.
|
Package sqlite is the SQLite dialect of the framework's database layer: Init opens the default connection when the configuration selects SQLite, and New opens a handle from a configuration of the caller's. |
|
Package datatypes holds the types a model declares the fields of a kind of its own with: a calendar day, a time of day, and a JSON document stored in one column.
|
Package datatypes holds the types a model declares the fields of a kind of its own with: a calendar day, a time of day, and a JSON document stored in one column. |
|
Package dbmigrate renders registered Go models into a target schema and migrates a database towards it.
|
Package dbmigrate renders registered Go models into a target schema and migrates a database towards it. |
|
Package dcache provides a replicated in-memory cache: a per-process store whose set and delete operations propagate to the store of every other instance through Kafka events.
|
Package dcache provides a replicated in-memory cache: a per-process store whose set and delete operations propagate to the store of every other instance through Kafka events. |
|
ds
|
|
|
heap/binaryheap
Package binaryheap is a generic binary heap ordered by a comparison function: a min-heap by default, the smallest element coming out first, and a max-heap with WithMaxHeap.
|
Package binaryheap is a generic binary heap ordered by a comparison function: a min-heap by default, the smallest element coming out first, and a max-heap with WithMaxHeap. |
|
list/arraylist
Package arraylist provides a generic implementation of a resizable array-backed list.
|
Package arraylist provides a generic implementation of a resizable array-backed list. |
|
list/linkedlist
Package linkedlist provides a doubly-linked list with a front and a back.
|
Package linkedlist provides a doubly-linked list with a front and a back. |
|
list/skiplist
Package skiplist is a generic skip list: keys kept in the order of a comparison function, each with its value, and found, inserted and deleted in logarithmic time on average.
|
Package skiplist is a generic skip list: keys kept in the order of a comparison function, each with its value, and found, inserted and deleted in logarithmic time on average. |
|
mapset
Package mapset is a generic set backed by a map.
|
Package mapset is a generic set backed by a map. |
|
multimap
Package multimap is a generic map holding any number of values under each key, the values told apart by a comparison function.
|
Package multimap is a generic map holding any number of values under each key, the values told apart by a comparison function. |
|
queue/arrayqueue
Package arrayqueue is a generic first-in, first-out queue backed by a slice.
|
Package arrayqueue is a generic first-in, first-out queue backed by a slice. |
|
queue/circularbuffer
Package circularbuffer is a generic circular buffer of a fixed size: once full it overwrites its oldest element with each new one, or, with WithDrop, refuses the new one.
|
Package circularbuffer is a generic circular buffer of a fixed size: once full it overwrites its oldest element with each new one, or, with WithDrop, refuses the new one. |
|
queue/linkedqueue
Package linkedqueue is a generic first-in, first-out queue backed by a linked list.
|
Package linkedqueue is a generic first-in, first-out queue backed by a linked list. |
|
queue/priorityqueue
Package priorityqueue is a generic priority queue built on a binary heap and ordered by a comparison function: the smallest element comes out first by default, the largest with WithMaxPriority.
|
Package priorityqueue is a generic priority queue built on a binary heap and ordered by a comparison function: the smallest element comes out first by default, the largest with WithMaxPriority. |
|
stack/arraystack
Package arraystack is a generic last-in, first-out stack backed by a slice.
|
Package arraystack is a generic last-in, first-out stack backed by a slice. |
|
stack/linkedstack
Package linkedstack is a generic last-in, first-out stack backed by a linked list.
|
Package linkedstack is a generic last-in, first-out stack backed by a linked list. |
|
tree/avltree
Package avltree is a generic AVL tree: a self-balancing binary search tree holding keys in the order of a comparison function, each with its value.
|
Package avltree is a generic AVL tree: a self-balancing binary search tree holding keys in the order of a comparison function, each with its value. |
|
tree/rbtree
Package rbtree is a generic red-black tree: a self-balancing binary search tree holding keys in the order of a comparison function, each with its value.
|
Package rbtree is a generic red-black tree: a self-balancing binary search tree holding keys in the order of a comparison function, each with its value. |
|
tree/splaytree
Package splaytree is a generic splay tree: a binary search tree holding keys in the order of a comparison function, each with its value, in which a lookup moves the node it ended on to the root, so keys looked up often stay near it.
|
Package splaytree is a generic splay tree: a binary search tree holding keys in the order of a comparison function, each with its value, in which a lookup moves the node it ended on to the root, so keys looked up often stay near it. |
|
tree/trie
Package trie is a generic trie: a tree keyed by sequences of K, the runes of a string for one, in which keys sharing a prefix share the path that spells it, each key with its value.
|
Package trie is a generic trie: a tree keyed by sequences of K, the runes of a string for one, in which keys sharing a prefix share the path that spells it, each key with its value. |
|
types
Package types holds what the data structure packages under ds share: the iterator and container interfaces they implement, the locker a structure guards itself with, and the errors they return.
|
Package types holds what the data structure packages under ds share: the iterator and container interfaces they implement, the locker a structure guards itself with, and the errors they return. |
|
Package dsl provides a Domain Specific Language (DSL) for defining REST API designs for Go models.
|
Package dsl provides a Domain Specific Language (DSL) for defining REST API designs for Go models. |
|
Package filetype tells the type of a file from its content, as a Filetype with its Mime.
|
Package filetype tells the type of a file from its content, as a Filetype with its Mime. |
|
Package grpc is the gRPC listener's API for a project's own code.
|
Package grpc is the gRPC listener's API for a project's own code. |
|
Package i18n registers the translations of the sentences a module, or a project, answers its clients with.
|
Package i18n registers the translations of the sentences a module, or a project, answers its clients with. |
|
Package inspect forwards the framework's model rules to the program gg builds to inspect a project's models.
|
Package inspect forwards the framework's model rules to the program gg builds to inspect a project's models. |
|
Package interceptor is the gRPC counterpart of package middleware: the interceptors a project mounts on the gRPC listener.
|
Package interceptor is the gRPC counterpart of package middleware: the interceptors a project mounts on the gRPC listener. |
|
internal
|
|
|
apiaction
Package apiaction holds the vocabulary of an action a model declares: the phases of an action, the action itself and the hooks run before and after it, and the rule of the path of a route, the route under the API prefix and the segment the CRUD layout appends to it for an action.
|
Package apiaction holds the vocabulary of an action a model declares: the phases of an action, the action itself and the hooks run before and after it, and the rule of the path of a route, the route under the API prefix and the segment the CRUD layout appends to it for an action. |
|
apidoc
Package apidoc keeps what the generated OpenAPI document describes an API with: the doc comments of structs, their fields and enums, the security schemes a request authenticates by, and the summary and description of an operation, registered or derived from the doc comment of its model.
|
Package apidoc keeps what the generated OpenAPI document describes an API with: the doc comments of structs, their fields and enums, the security schemes a request authenticates by, and the summary and description of an operation, registered or derived from the doc comment of its model. |
|
auditmanager
Package auditmanager writes the operation log: an entry for every operation the audit configuration does not exclude, written by the handler that performed the operation, before the request answers.
|
Package auditmanager writes the operation log: an entry for every operation the audit configuration does not exclude, written by the handler that performed the operation, before the request answers. |
|
cache/bigcache
Package bigcache adapts github.com/allegro/bigcache/v3 to gst.Cache: a sharded cache that stores serialized values, encoded through codec, so it is for plain data only (see the public cache package).
|
Package bigcache adapts github.com/allegro/bigcache/v3 to gst.Cache: a sharded cache that stores serialized values, encoded through codec, so it is for plain data only (see the public cache package). |
|
cache/cachetest
Package cachetest provides the conformance suite every gst.Cache backend must pass.
|
Package cachetest provides the conformance suite every gst.Cache backend must pass. |
|
cache/capacity
Package capacity resolves the per-type entry bound shared by the entry-addressed cache backends, so the configuration is read in one place rather than copied into each of them.
|
Package capacity resolves the per-type entry bound shared by the entry-addressed cache backends, so the configuration is read in one place rather than copied into each of them. |
|
cache/ccache
Package ccache adapts github.com/karlseguin/ccache/v3 to gst.Cache: a cache of live values with a lifetime per entry, bounded by the per-type entry bound (see capacity).
|
Package ccache adapts github.com/karlseguin/ccache/v3 to gst.Cache: a cache of live values with a lifetime per entry, bounded by the per-type entry bound (see capacity). |
|
cache/cmap
Package cmap adapts github.com/orcaman/concurrent-map/v2 to gst.Cache: a sharded map of live values with no expiration and no entry bound.
|
Package cmap adapts github.com/orcaman/concurrent-map/v2 to gst.Cache: a sharded map of live values with no expiration and no entry bound. |
|
cache/codec
Package codec encodes cache values for the backends that store bytes rather than live objects.
|
Package codec encodes cache values for the backends that store bytes rather than live objects. |
|
cache/defaultcache
Package defaultcache is the in-memory cache backend the framework forwards as its default, freelru: the one place the choice is made.
|
Package defaultcache is the in-memory cache backend the framework forwards as its default, freelru: the one place the choice is made. |
|
cache/fastcache
Package fastcache adapts github.com/VictoriaMetrics/fastcache to gst.Cache: a cache sized in bytes that stores serialized values, encoded through codec, so it is for plain data only (see the public cache package).
|
Package fastcache adapts github.com/VictoriaMetrics/fastcache to gst.Cache: a cache sized in bytes that stores serialized values, encoded through codec, so it is for plain data only (see the public cache package). |
|
cache/freecache
Package freecache adapts github.com/coocood/freecache to gst.Cache: a cache sized in bytes that stores serialized values, encoded through codec, so it is for plain data only (see the public cache package).
|
Package freecache adapts github.com/coocood/freecache to gst.Cache: a cache sized in bytes that stores serialized values, encoded through codec, so it is for plain data only (see the public cache package). |
|
cache/freelru
Package freelru is a sharded LRU cache that stores live values.
|
Package freelru is a sharded LRU cache that stores live values. |
|
cache/lru
Package lru adapts github.com/hashicorp/golang-lru/v2 to gst.Cache: a cache of live values that evicts the least recently used entry past the per-type entry bound (see capacity).
|
Package lru adapts github.com/hashicorp/golang-lru/v2 to gst.Cache: a cache of live values that evicts the least recently used entry past the per-type entry bound (see capacity). |
|
cache/otter
Package otter is a W-TinyLFU cache.
|
Package otter is a W-TinyLFU cache. |
|
cache/registry
Package registry provides the shared per-type singleton store used by the in-memory cache backends.
|
Package registry provides the shared per-type singleton store used by the in-memory cache backends. |
|
cache/ristretto
Package ristretto is a TinyLFU-admission cache.
|
Package ristretto is a TinyLFU-admission cache. |
|
cache/smap
Package smap adapts sync.Map to gst.Cache: a map of live values with no expiration and no entry bound.
|
Package smap adapts sync.Map to gst.Cache: a map of live values with no expiration and no entry bound. |
|
cache/tracing
Package tracing wraps cache backends that talk to remote systems with OpenTelemetry spans.
|
Package tracing wraps cache backends that talk to remote systems with OpenTelemetry spans. |
|
clioutput
Package clioutput is how gg writes to the terminal: the few line shapes every command prints with, so that all of them read alike.
|
Package clioutput is how gg writes to the terminal: the few line shapes every command prints with, so that all of them read alike. |
|
cmd/apidocgen
command
Command apidocgen regenerates the apidoc registration files of the framework packages that ship struct doc comments to the OpenAPI generator.
|
Command apidocgen regenerates the apidoc registration files of the framework packages that ship struct doc comments to the OpenAPI generator. |
|
cmd/selfcheck
command
Command selfcheck holds the framework's own source to the rules golangci-lint cannot express, and prints each violation it finds.
|
Command selfcheck holds the framework's own source to the rules golangci-lint cannot express, and prints each violation it finds. |
|
cmd/testcachefix
command
Command testcachefix writes back the test results go keeps under one key only, so a cached test never links its binary again.
|
Command testcachefix writes back the test results go keeps under one key only, so a cached test never links its binary again. |
|
controller
Package controller serves the actions of the registered routes on both transports: over HTTP through the handlers the router mounts (CreateHandler and its kind), over gRPC through the call functions the generated pb package runs (CreateCall and its kind).
|
Package controller serves the actions of the registered routes on both transports: over HTTP through the handlers the router mounts (CreateHandler and its kind), over gRPC through the call functions the generated pb package runs (CreateCall and its kind). |
|
cqlpolicy
Package cqlpolicy builds the gocql policies the cassandra and scylla providers configure from settings both of them carry, so that a setting means the same in either: the retry policy downgrading_consistency names and the tries a reconnection policy makes.
|
Package cqlpolicy builds the gocql policies the cassandra and scylla providers configure from settings both of them carry, so that a setting means the same in either: the retry policy downgrading_consistency names and the tries a reconnection policy makes. |
|
datatypes
Package datatypes holds the types a model declares the fields of a kind of its own with: a calendar day, a time of day, and a JSON document stored in one column, an array, an object or a value of any Go type.
|
Package datatypes holds the types a model declares the fields of a kind of its own with: a calendar day, a time of day, and a JSON document stored in one column, an array, an object or a value of any Go type. |
|
dbruntime
Package dbruntime holds the database runtime below the public database package: what that package, the dialect packages and the framework's other users of the database share, and a project never sees.
|
Package dbruntime holds the database runtime below the public database package: what that package, the dialect packages and the framework's other users of the database share, and a project never sees. |
|
dbruntime/dbnode
Package dbnode names the roles of the nodes a database handle writes to and reads from, and stamps the role that serves a statement on the statement's context, for the SQL log to report which node ran it.
|
Package dbnode names the roles of the nodes a database handle writes to and reads from, and stamps the role that serves a statement on the statement's context, for the SQL log to report which node ran it. |
|
debug/gops
Package gops runs the gops agent, through which the gops command inspects the running process, when the configuration enables it (config.App's GopsEnabled): bootstrap starts it with the process and stops it as the process shuts down.
|
Package gops runs the gops agent, through which the gops command inspects the running process, when the configuration enables it (config.App's GopsEnabled): bootstrap starts it with the process and stops it as the process shuts down. |
|
debug/pprof
Package debugpprof provides an HTTP server for pprof endpoints; the package name avoids conflicting with the standard library "pprof" packages.
|
Package debugpprof provides an HTTP server for pprof endpoints; the package name avoids conflicting with the standard library "pprof" packages. |
|
debug/statsviz
Package statsviz serves the statsviz page, live charts of the Go runtime's metrics, on a listener of its own when the configuration enables it (config.App's StatsvizEnabled): bootstrap starts the server with the process and stops it as the process shuts down.
|
Package statsviz serves the statsviz page, live charts of the Go runtime's metrics, on a listener of its own when the configuration enables it (config.App's StatsvizEnabled): bootstrap starts the server with the process and stops it as the process shuts down. |
|
dsl
Package dsl reads the designs the models of a project declare with the keywords of the public dsl package: Parse turns a model file into the Design of each of its models, Validate reports the declarations the generator cannot honor, and Design and Action are what gg gen, gg check and the generators consume.
|
Package dsl reads the designs the models of a project declare with the keywords of the public dsl package: Parse turns a model file into the Design of each of its models, Validate reports the declarations the generator cannot honor, and Design and Action are what gg gen, gg check and the generators consume. |
|
errorstack
Package errorstack extracts stack traces embedded in errors, shared by tracing and logging so both report the same error origin stack format.
|
Package errorstack extracts stack traces embedded in errors, shared by tracing and logging so both report the same error origin stack format. |
|
execctx
Package execctx carries the identity of the unit of work a context belongs to.
|
Package execctx carries the identity of the unit of work a context belongs to. |
|
ggcheck
Package ggcheck holds the rules gg check holds a business project to.
|
Package ggcheck holds the rules gg check holds a business project to. |
|
ggconfig
Package ggconfig loads the project-level gst configuration file (gst.yaml) that gg commands consume at build time.
|
Package ggconfig loads the project-level gst configuration file (gst.yaml) that gg commands consume at build time. |
|
ggconst
Package ggconst holds the conventions the framework's tooling shares: the import paths of the framework packages, the names of the files, packages, fields and symbols gg generates and reads, and the patterns it recognizes them by.
|
Package ggconst holds the conventions the framework's tooling shares: the import paths of the framework packages, the names of the files, packages, fields and symbols gg generates and reads, and the patterns it recognizes them by. |
|
gggen
Package gggen builds the code gg gen writes: the registration files, the service files and their test scaffolds, and, in its sub-packages, the column references, the TypeScript declarations and the protobuf definitions.
|
Package gggen builds the code gg gen writes: the registration files, the service files and their test scaffolds, and, in its sub-packages, the column references, the TypeScript declarations and the protobuf definitions. |
|
gggen/columns
Package columns generates the typed column references of a project's models, so filters name columns through the compiler instead of through string literals.
|
Package columns generates the typed column references of a project's models, so filters name columns through the compiler instead of through string literals. |
|
gggen/pb
Package pb generates the protobuf definitions of a gst project's gRPC services and the Go files serving them, from the schema pbschema derives of the models declaring GRPC(): the definitions printed as .proto files that mirror the model directory under pb/; beside each, a .gen.go with the type serving the service, the calls of its actions, the handlers of its rpcs and the conversions between the messages and the Go types (see handlerFile); and, in every package under pb/, a pb.gen.go registering its services on the listener (see registrationFiles).
|
Package pb generates the protobuf definitions of a gst project's gRPC services and the Go files serving them, from the schema pbschema derives of the models declaring GRPC(): the definitions printed as .proto files that mirror the model directory under pb/; beside each, a .gen.go with the type serving the service, the calls of its actions, the handlers of its rpcs and the conversions between the messages and the Go types (see handlerFile); and, in every package under pb/, a pb.gen.go registering its services on the listener (see registrationFiles). |
|
gggen/ts
Package ts generates the TypeScript declarations of the Go types a gst project's API routes send and receive.
|
Package ts generates the TypeScript declarations of the Go types a gst project's API routes send and receive. |
|
gghelper
Package gghelper holds what more than one of gg's packages needs about the project gg runs in: the module path its go.mod declares, the paths gg leaves out of it, the ones its Git ignore rules exclude and the ones the go command leaves out, programs and package listings run against its module, and the small file and path helpers the commands share.
|
Package gghelper holds what more than one of gg's packages needs about the project gg runs in: the module path its go.mod declares, the paths gg leaves out of it, the ones its Git ignore rules exclude and the ones the go command leaves out, programs and package listings run against its module, and the small file and path helpers the commands share. |
|
gghelper/program/inspect
command
The inspection program reports the project models' columns, what their index declarations violate on MySQL, the framework columns they rename, the query names they declare ambiguously and the ID accessors they lack for an ID of their own, as JSON written to the file its argument names: it is what gg gen and gg check build and run inside the project.
|
The inspection program reports the project models' columns, what their index declarations violate on MySQL, the framework columns they rename, the query names they declare ambiguously and the ID accessors they lack for an ID of their own, as JSON written to the file its argument names: it is what gg gen and gg check build and run inside the project. |
|
gghelper/program/migrate
command
The migration program migrates a project's database to its models, or dumps the schema its models describe: it is what gg migrate builds and runs inside the project.
|
The migration program migrates a project's database to its models, or dumps the schema its models describe: it is what gg migrate builds and runs inside the project. |
|
ggmodule
Package ggmodule implements the behavior behind the gg module command family: discovering framework modules (list), registering a module import in the project's module/module.go (add, remove), and materializing a module into the project as project-owned source (copy).
|
Package ggmodule implements the behavior behind the gg module command family: discovering framework modules (list), registering a module import in the project's module/module.go (add, remove), and materializing a module into the project as project-owned source (copy). |
|
ggnew
Package ggnew scaffolds the project gg new creates: the first version of every package the generated main.go imports, so the project compiles before its first generation.
|
Package ggnew scaffolds the project gg new creates: the first version of every package the generated main.go imports, so the project compiles before its first generation. |
|
ggprune
Package ggprune works out what gg prune deletes from a project's service and pb directories, and deletes it: the service files of disabled actions, the unmanaged files of service directories no model owns, the files under pb/ gg gen would not write now (see PlanPBFiles), and the directories that leaves empty.
|
Package ggprune works out what gg prune deletes from a project's service and pb directories, and deletes it: the service files of disabled actions, the unmanaged files of service directories no model owns, the files under pb/ gg gen would not write now (see PlanPBFiles), and the directories that leaves empty. |
|
goast
Package goast holds the go/ast helpers the framework's tooling shares: the questions asked of an expression, a statement or a declaration (IsQualified, AlwaysLeaves, FindStructTypeSpec), the edits of a file's imports and identifiers (InsertImportSpec, RenameIdent), the recognition of the framework's service base and of test functions (IsServiceBase, IsTestCaseFunc), and the header and line positions a generated file is printed with (GeneratedHeader, LineSet).
|
Package goast holds the go/ast helpers the framework's tooling shares: the questions asked of an expression, a statement or a declaration (IsQualified, AlwaysLeaves, FindStructTypeSpec), the edits of a file's imports and identifiers (InsertImportSpec, RenameIdent), the recognition of the framework's service base and of test functions (IsServiceBase, IsTestCaseFunc), and the header and line positions a generated file is printed with (GeneratedHeader, LineSet). |
|
grpcserver
Package grpcserver serves the gRPC services of the models declaring GRPC(), on a listener of its own beside the HTTP one and on the same lifecycle: bootstrap starts it with the other listeners, drains it with the readiness probe and stops it side by side with the HTTP listener within the shutdown's window, its streams ending as the stop begins.
|
Package grpcserver serves the gRPC services of the models declaring GRPC(), on a listener of its own beside the HTTP one and on the same lifecycle: bootstrap starts it with the other listeners, drains it with the readiness probe and stops it side by side with the HTTP listener within the shutdown's window, its streams ending as the stop begins. |
|
gst
Package gst defines the contracts between the framework and business projects: the Model, Service, Database, Selector, Cache, RBAC, and Logger interfaces, the query building blocks they exchange (Filter, Order, Cursor, Column, Term, Window), and the per-request ServiceContext.
|
Package gst defines the contracts between the framework and business projects: the Model, Service, Database, Selector, Cache, RBAC, and Logger interfaces, the query building blocks they exchange (Filter, Order, Cursor, Column, Term, Window), and the per-request ServiceContext. |
|
hookoverride
Package hookoverride tells whether a type overrides a method beyond the framework base it embeds, reading the answer off the compiled binary.
|
Package hookoverride tells whether a type overrides a method beyond the framework base it embeds, reading the answer off the compiled binary. |
|
httpwrapper
Package httpwrapper provides JSON round-trip wrappers around *http.Request and *http.Response.
|
Package httpwrapper provides JSON round-trip wrappers around *http.Request and *http.Response. |
|
i18n
Package i18n holds the language a process answers its clients in and the translations of the sentences it answers them with.
|
Package i18n holds the language a process answers its clients in and the translations of the sentences it answers them with. |
|
instance
Package instance answers one question — which process is this — for every part of the framework that tells replicas apart: the field every log entry carries, the tracing resource, the origin a replicated cache event names.
|
Package instance answers one question — which process is this — for every part of the framework that tells replicas apart: the field every log entry carries, the tracing resource, the origin a replicated cache event names. |
|
jsonshape
Package jsonshape reads what the types of a gst project look like on the wire: the JSON encoding/json writes for them, which is the codec of the framework's response envelope and request binding.
|
Package jsonshape reads what the types of a gst project look like on the wire: the JSON encoding/json writes for them, which is the codec of the framework's response envelope and request binding. |
|
jsonshape/fixture/a-b
Package ab lives in a directory whose name maps to the same TypeScript import name as the a_b fixture package.
|
Package ab lives in a directory whose name maps to the same TypeScript import name as the a_b fixture package. |
|
jsonshape/fixture/a_b
Package ab lives in a directory whose name maps to the same TypeScript import name as the a-b fixture package.
|
Package ab lives in a directory whose name maps to the same TypeScript import name as the a-b fixture package. |
|
jsonshape/fixture/gst
Package gst sits where its output file would be gst.ts, the name of the framework prelude.
|
Package gst sits where its output file would be gst.ts, the name of the framework prelude. |
|
jsonshape/fixture/mode
Package mode declares an enum type another fixture package declares a further constant of.
|
Package mode declares an enum type another fixture package declares a further constant of. |
|
jsonshape/fixture/model/record
Package record declares fixture types the sample fixture refers to from another package.
|
Package record declares fixture types the sample fixture refers to from another package. |
|
jsonshape/fixture/model/sample
Package sample declares the fixture types the TypeScript generator tests start from.
|
Package sample declares the fixture types the TypeScript generator tests start from. |
|
jsonshape/fixture/pkg/notifier
Package notifier declares a fixture type a model refers to from outside the model directory.
|
Package notifier declares a fixture type a model refers to from outside the model directory. |
|
jsonshape/fixture/unsupported
Package unsupported declares fixture types whose JSON shape the TypeScript generator cannot describe.
|
Package unsupported declares fixture types whose JSON shape the TypeScript generator cannot describe. |
|
lease
Package lease is the coordination primitive the framework's distributed capabilities stand on: a name that at most one healthy process among those sharing the primary database holds at a time.
|
Package lease is the coordination primitive the framework's distributed capabilities stand on: a name that at most one healthy process among those sharing the primary database holds at a time. |
|
lifecycle
Package lifecycle is the registry of the framework components that have a lifetime of their own: clients of external systems, the scheduler, election loops, anything that owns a connection or a background goroutine — and, through the component package, a project's own long-running work.
|
Package lifecycle is the registry of the framework components that have a lifetime of their own: clients of external systems, the scheduler, election loops, anything that owns a connection or a background goroutine — and, through the component package, a project's own long-running work. |
|
logfield
Package logfield declares log fields more than one stream of the framework writes, each as one constructor fixing the field's key and its type.
|
Package logfield declares log fields more than one stream of the framework writes, each as one constructor fixing the field's key and its type. |
|
logger
Package logger holds the framework's log streams, one per component, and the loggers behind them: Init opens the streams the configuration names, and New builds a logger of its own for a component that has one.
|
Package logger holds the framework's log streams, one per component, and the loggers behind them: Init opens the streams the configuration names, and New builds a logger of its own for a component that has one. |
|
metrics
Package prommetrics provides Prometheus metrics for the application; the name avoids conflicting with standard library or common "metrics" package names.
|
Package prommetrics provides Prometheus metrics for the application; the name avoids conflicting with standard library or common "metrics" package names. |
|
middleware
Package middleware holds the middleware the framework mounts itself and the machinery that mounts the rest: the built-in chain ahead of every route, the registry Register and RegisterAuth fill, and the registries the router fills as routes register — route parameters and streaming routes — together with the circuit breaker built from configuration at startup.
|
Package middleware holds the middleware the framework mounts itself and the machinery that mounts the rest: the built-in chain ahead of every route, the registry Register and RegisterAuth fill, and the registries the router fills as routes register — route parameters and streaming routes — together with the circuit breaker built from configuration at startup. |
|
model
Package model contains the internal model infrastructure behind the public model package.
|
Package model contains the internal model infrastructure behind the public model package. |
|
modelinspect
Package modelinspect inspects a project's models by running them.
|
Package modelinspect inspects a project's models by running them. |
|
modelschema
Package modelschema resolves what a model struct declares about its table: its database columns, the kind of value each stores and the URL query name each takes (see Column and ClassifyColumn), the columns the framework fixes the names of (see ValidateFrameworkColumns and DefaultCursorColumn), the secondary indexes it declares (see Index), its optimistic-locking column (see Version), the columns identifying one of its rows (see IdentifyingColumns), its associations (see AssociationFields) and the fields it declares read-only to clients (see IsReadOnly); and the fingerprint of everything a set of models declares about their tables (see Fingerprint).
|
Package modelschema resolves what a model struct declares about its table: its database columns, the kind of value each stores and the URL query name each takes (see Column and ClassifyColumn), the columns the framework fixes the names of (see ValidateFrameworkColumns and DefaultCursorColumn), the secondary indexes it declares (see Index), its optimistic-locking column (see Version), the columns identifying one of its rows (see IdentifyingColumns), its associations (see AssociationFields) and the fields it declares read-only to clients (see IsReadOnly); and the fingerprint of everything a set of models declares about their tables (see Fingerprint). |
|
modelsource
Package modelsource reads the models of a project the way gg sees them: the model files under the model directory, each model with the design its DSL declares, its routes resolved through the resource hierarchy and the gst.yaml ignore rules, the service files its actions map to, and the doc comments the API document registers.
|
Package modelsource reads the models of a project the way gg sees them: the model files under the model directory, each model with the design its DSL declares, its routes resolved through the resource hierarchy and the gst.yaml ignore rules, the service files its actions map to, and the doc comments the API document registers. |
|
openapigen
Package openapigen builds the OpenAPI document a running service serves.
|
Package openapigen builds the OpenAPI document a running service serves. |
|
operation
Package operation begins the framework's own background operations — a round of a cron job, a tenure of a leader work — with the identity the rest of the operation is annotated with: a trace id, taken from a root span when tracing is on and generated otherwise, the way a request takes its own at the listener.
|
Package operation begins the framework's own background operations — a round of a cron job, a tenure of a leader work — with the identity the rest of the operation is annotated with: a trace id, taken from a root span when tracing is on and generated otherwise, the way a request takes its own at the listener. |
|
otel
Package otel is the framework's OpenTelemetry tracing: it builds the tracer provider from the otel configuration and exports spans over OTLP, names the spans the framework owns, and records errors and recovered panics on them.
|
Package otel is the framework's OpenTelemetry tracing: it builds the tracer provider from the otel configuration and exports spans over OTLP, names the spans the framework owns, and records errors and recovered panics on them. |
|
pbschema
Package pbschema derives the protobuf definitions of a gst project's gRPC services: for every model whose Design declares GRPC(), the messages its Go types encode to and the service exposing its actions, as the descriptors of the .proto files that mirror the model directory under pb/, held to the files already committed there (see Derive).
|
Package pbschema derives the protobuf definitions of a gst project's gRPC services: for every model whose Design declares GRPC(), the messages its Go types encode to and the service exposing its actions, as the descriptors of the .proto files that mirror the model directory under pb/, held to the files already committed there (see Derive). |
|
requestctx
Package requestctx carries what names a request below its handler.
|
Package requestctx carries what names a request below its handler. |
|
router
Package router builds the HTTP server a gst process serves: the engine carrying the framework's middleware chain and operational endpoints, the route groups registered routes attach to, the routes-ready hooks, and the server's start and shutdown.
|
Package router builds the HTTP server a gst process serves: the engine carrying the framework's middleware chain and operational endpoints, the route groups registered routes attach to, the routes-ready hooks, and the server's start and shutdown. |
|
service
Package service holds what stands behind the public service package: the base every service embeds, with the hooks it defaults and the query helpers it lends, the registry of the services the controllers run, and the detection of the hooks a service overrides.
|
Package service holds what stands behind the public service package: the base every service embeds, with the hooks it defaults and the query helpers it lends, the registry of the services the controllers run, and the detection of the hooks a service overrides. |
|
sse
Package sse implements Server-Sent Events (SSE) for the framework.
|
Package sse implements Server-Sent Events (SSE) for the framework. |
|
streamctx
Package streamctx gives a stream a context that ends when the server it is served on begins to shut down.
|
Package streamctx gives a stream a context that ends when the server it is served on begins to shut down. |
|
structdoc
Package structdoc parses Go source code and extracts the doc comments of exported struct declarations and their exported fields.
|
Package structdoc parses Go source code and extracts the doc comments of exported struct declarations and their exported fields. |
|
tenant
Package tenant implements the row scoping the public tenant package forwards: the column type whose clauses Gorm applies to every statement of a schema carrying it, the struct a model embeds to carry that column, and the context a statement takes its tenant from.
|
Package tenant implements the row scoping the public tenant package forwards: the column type whose clauses Gorm applies to every statement of a schema carrying it, the struct a model embeds to carry that column, and the context a statement takes its tenant from. |
|
testutil
Package testutil is the test support the public testutil package forwards to projects and the framework's own suites run on.
|
Package testutil is the test support the public testutil package forwards to projects and the framework's own suites run on. |
|
testutil/golist
Package golist reads the packages of the module a test runs in through go list, for a test that reads the source of packages other than its own.
|
Package golist reads the packages of the module a test runs in through go list, for a test that reads the source of packages other than its own. |
|
testutil/oteltest
Package oteltest turns real OpenTelemetry tracing on inside one framework test and reads back the spans it exports.
|
Package oteltest turns real OpenTelemetry tracing on inside one framework test and reads back the spans it exports. |
|
testutil/providertest
Package providertest runs the tests of a provider package against the external services they need, with the framework brought up as far as its provider stage and no further.
|
Package providertest runs the tests of a provider package against the external services they need, with the framework brought up as far as its provider stage and no further. |
|
testutil/swap
Package swap replaces process-wide values for the duration of one test.
|
Package swap replaces process-wide values for the duration of one test. |
|
testutil/testcontainer
Package testcontainer prepares the services the framework's tests run against, in containers started through testcontainers-go.
|
Package testcontainer prepares the services the framework's tests run against, in containers started through testcontainers-go. |
|
testutil/testlog
Package testlog keeps the framework's logs of a test process out of the test output and out of the package source tree, where log files changing with every run would make go's test cache rerun every test that reads or lists the tree.
|
Package testlog keeps the framework's logs of a test process out of the test output and out of the package source tree, where log files changing with every run would make go's test cache rerun every test that reads or lists the tree. |
|
tlsconfig
Package tlsconfig builds the TLS configuration a client of the framework dials with, from the four settings every component configures it by: the certificate file, its key file, the CA file and whether to skip verification.
|
Package tlsconfig builds the TLS configuration a client of the framework dials with, from the four settings every component configures it by: the certificate file, its key file, the CA file and whether to skip verification. |
|
tunnel
Package tunnel is the communication protocol between a server and its users, and between a server and its clients.
|
Package tunnel is the communication protocol between a server and its users, and between a server and its clients. |
|
urlquery
Package urlquery translates URL query parameters into the arguments the database layer builds a query from.
|
Package urlquery translates URL query parameters into the arguments the database layer builds a query from. |
|
websocket
Package websocket serves and dials the WebSocket connections a stream travels on over HTTP: every message one text frame holding a JSON document, the client's last one followed by a frame holding null.
|
Package websocket serves and dials the WebSocket connections a stream travels on over HTTP: every message one text frame holding a JSON document, the client's last one followed by a frame holding null. |
|
Package leader runs, on one replica of a deployment at a time, the work a project registers: a loop that polls an external system, a relay that forwards an outbox, the one connection a protocol allows.
|
Package leader runs, on one replica of a deployment at a time, the work a project registers: a loop that polls an external system, a relay that forwards an outbox, the one connection a protocol allows. |
|
Package lock runs a piece of work once at a time across a deployment: an administrator's "rebuild the report", a refresh of a credential every replica shares, anything that must not run twice at once and is done when it returns.
|
Package lock runs a piece of work once at a time across a deployment: an administrator's "rebuild the report", a refresh of a credential every replica shares, anything that must not run twice at once and is done when it returns. |
|
Package logger is where the code of a project logs.
|
Package logger is where the code of a project logs. |
|
Package middleware is the HTTP middleware a project mounts: Register adds middleware to every API route, RegisterAuth to the routes of the authenticated group, and the constructors here build the middleware the framework ships for either.
|
Package middleware is the HTTP middleware a project mounts: Register adds middleware to every API route, RegisterAuth to the routes of the authenticated group, and the constructors here build the middleware the framework ships for either. |
|
ratelimiter
Package ratelimiter is a gin middleware limiting the rate of requests per key, with buckets kept in the process: a request over the limit is refused with 429.
|
Package ratelimiter is a gin middleware limiting the rate of requests per key, with buckets kept in the process: a request over the limit is refused with 429. |
|
Package model is what a project declares its models with: the base types a model embeds, Base, AutoBase and Empty; Query and Cursor, which a model embeds to shape how its list is read; Index, which declares an index, and Version, which opts a model into optimistic locking; and Register, which registers a database-backed model for table setup.
|
Package model is what a project declares its models with: the base types a model embeds, Base, AutoBase and Empty; Query and Cursor, which a model embeds to shape how its list is read; Index, which declares an index, and Version, which opts a model into optimistic locking; and Register, which registers a database-backed model for table setup. |
|
Package module provides a unified module registration system that automatically registers models, services, and HTTP routes for CRUD operations.
|
Package module provides a unified module registration system that automatically registers models, services, and HTTP routes for CRUD operations. |
|
authz
Package authz is the RBAC authorization module: roles, role bindings, authorization rules and menus, with the routes that manage them.
|
Package authz is the RBAC authorization module: roles, role bindings, authorization rules and menus, with the routes that manage them. |
|
column
Package column is the module that answers which distinct values the columns of a table hold, for the tables and columns a project registers, under the filters a request names among those columns.
|
Package column is the module that answers which distinct values the columns of a table hold, for the tables and columns a project registers, under the filters a request names among those columns. |
|
email
Package email is the module of email verification, password reset by email and email change for IAM accounts.
|
Package email is the module of email verification, password reset by email and email change for IAM accounts. |
|
helloworld
Package helloworld is the complete module example projects are pointed to: one module on an empty model with request and response types of its own, and one on a table-backed model with before and after hooks for each action.
|
Package helloworld is the complete module example projects are pointed to: one module on an empty model with request and response types of its own, and one on a table-backed model with before and after hooks for each action. |
|
iam
Package iam is the identity and access module: users and their accounts, login, and sessions, with the routes that serve them.
|
Package iam is the identity and access module: users and their accounts, login, and sessions, with the routes that serve them. |
|
logmgmt
Package logmgmt is the module of login logs and operation logs: the two models and the routes that read them.
|
Package logmgmt is the module of login logs and operation logs: the two models and the routes that read them. |
|
mfa
Package mfa is the module of multi-factor authentication by TOTP: the routes an account binds, confirms and unbinds its authenticator with, the administrative routes over the authenticators of other accounts, and the second-factor gate of the login.
|
Package mfa is the module of multi-factor authentication by TOTP: the routes an account binds, confirms and unbinds its authenticator with, the administrative routes over the authenticators of other accounts, and the second-factor gate of the login. |
|
version
Package versionmod provides the version API module; the name avoids conflicting with the standard library "runtime/version" package.
|
Package versionmod provides the version API module; the name avoids conflicting with the standard library "runtime/version" package. |
|
Package otel traces a project's own work beside the spans the framework records for every request.
|
Package otel traces a project's own work beside the spans the framework records for every request. |
|
provider
|
|
|
cassandra
Package cassandra is the Cassandra provider: Client returns the session the bootstrap opened from the configuration, and New opens another from a configuration of the caller's.
|
Package cassandra is the Cassandra provider: Client returns the session the bootstrap opened from the configuration, and New opens another from a configuration of the caller's. |
|
clickhouse
Package clickhouse provides the native ClickHouse client for analytical workloads: high-throughput batch ingestion and queries that bypass the gorm dialect.
|
Package clickhouse provides the native ClickHouse client for analytical workloads: high-throughput batch ingestion and queries that bypass the gorm dialect. |
|
elastic
Package elastic is the Elasticsearch provider: Client returns the client the bootstrap opened from the configuration, New opens another from a configuration of the caller's, and the helpers read, search and write documents, manage indexes and compose queries.
|
Package elastic is the Elasticsearch provider: Client returns the client the bootstrap opened from the configuration, New opens another from a configuration of the caller's, and the helpers read, search and write documents, manage indexes and compose queries. |
|
etcd
Package etcd is the etcd provider: Client returns the client the bootstrap opened from the configuration, and New opens another from a configuration of the caller's.
|
Package etcd is the etcd provider: Client returns the client the bootstrap opened from the configuration, and New opens another from a configuration of the caller's. |
|
influxdb
Package influxdb is the InfluxDB provider: Client returns the client the bootstrap opened from the configuration, the helpers query and write points through it, and New opens another from a configuration of the caller's.
|
Package influxdb is the InfluxDB provider: Client returns the client the bootstrap opened from the configuration, the helpers query and write points through it, and New opens another from a configuration of the caller's. |
|
kafka
Package kafka is the Kafka provider: Client returns the default client the bootstrap opened from the configuration, meant for producing and for administration, Admin returns an admin client over it, and New opens a client of the caller's own, which is how a consumer gets one carrying its subscription.
|
Package kafka is the Kafka provider: Client returns the default client the bootstrap opened from the configuration, meant for producing and for administration, Admin returns an admin client over it, and New opens a client of the caller's own, which is how a consumer gets one carrying its subscription. |
|
ldap
Package ldap is the LDAP provider: Client returns the connection the bootstrap opened from the configuration, the helpers search the directory, authenticate a user and manage users and groups through it, and New opens another from a configuration of the caller's.
|
Package ldap is the LDAP provider: Client returns the connection the bootstrap opened from the configuration, the helpers search the directory, authenticate a user and manage users and groups through it, and New opens another from a configuration of the caller's. |
|
minio
Package minio is the MinIO provider: Client returns the client the bootstrap opened from the configuration, the helpers work on buckets and the objects in them, and New opens another from a configuration of the caller's.
|
Package minio is the MinIO provider: Client returns the client the bootstrap opened from the configuration, the helpers work on buckets and the objects in them, and New opens another from a configuration of the caller's. |
|
mongo
Package mongo is the MongoDB provider: Client returns the client the bootstrap opened from the configuration, Database and Collection return handles of it, and New opens another from a configuration of the caller's.
|
Package mongo is the MongoDB provider: Client returns the client the bootstrap opened from the configuration, Database and Collection return handles of it, and New opens another from a configuration of the caller's. |
|
mqtt
Package mqtt is the MQTT provider: Client returns the client the bootstrap opened from the configuration, Publish, Subscribe and Unsubscribe work on topics through it, and New opens another from a configuration of the caller's.
|
Package mqtt is the MQTT provider: Client returns the client the bootstrap opened from the configuration, Publish, Subscribe and Unsubscribe work on topics through it, and New opens another from a configuration of the caller's. |
|
nats
Package nats is the NATS provider: Client returns the connection the bootstrap opened from the configuration, and New opens another from a configuration of the caller's.
|
Package nats is the NATS provider: Client returns the connection the bootstrap opened from the configuration, and New opens another from a configuration of the caller's. |
|
rethinkdb
Package rethinkdb is the RethinkDB provider: Client returns the session the bootstrap opened from the configuration, and New opens another from a configuration of the caller's.
|
Package rethinkdb is the RethinkDB provider: Client returns the session the bootstrap opened from the configuration, and New opens another from a configuration of the caller's. |
|
rocketmq
Package rocketmq is the RocketMQ provider: Producer and Admin return the producer and the admin client the bootstrap started from the configuration, and NewProducer, NewPushConsumer and NewAdmin build ones of the caller's own.
|
Package rocketmq is the RocketMQ provider: Producer and Admin return the producer and the admin client the bootstrap started from the configuration, and NewProducer, NewPushConsumer and NewAdmin build ones of the caller's own. |
|
scylla
Package scylla is the ScyllaDB provider: Client returns the session the bootstrap opened from the configuration, and New opens another from a configuration of the caller's.
|
Package scylla is the ScyllaDB provider: Client returns the session the bootstrap opened from the configuration, and New opens another from a configuration of the caller's. |
|
Package redis holds the process-wide Redis client, the typed cache backend built on it, and the helpers that share its keyspace.
|
Package redis holds the process-wide Redis client, the typed cache backend built on it, and the helpers that share its keyspace. |
|
Package requestctx is the public entry to the request metadata that storage and service logs name a request by.
|
Package requestctx is the public entry to the request metadata that storage and service logs name a request by. |
|
Package response exposes the response entry points that code outside the framework's controller path needs.
|
Package response exposes the response entry points that code outside the framework's controller path needs. |
|
Package router registers a project's HTTP routes and the hooks that run once they are ready.
|
Package router registers a project's HTTP routes and the hooks that run once they are ready. |
|
Package service exposes the public service extension points for application code: Base, the no-op service an application service embeds, Register, which registers a service type for a phase of a route, and the phases of an action a registration names, Create or List.
|
Package service exposes the public service extension points for application code: Base, the no-op service an application service embeds, Register, which registers a service type for a phase of a route, and the phases of an action a registration names, Create or List. |
|
Package sse exposes the framework's Server-Sent Events support to application code.
|
Package sse exposes the framework's Server-Sent Events support to application code. |
|
Package tenant scopes a model's rows to the tenant the caller acts in.
|
Package tenant scopes a model's rows to the tenant the caller acts in. |
|
Package testutil is the test suite a gst project writes its tests against.
|
Package testutil is the test suite a gst project writes its tests against. |
|
iamtest
Package iamtest logs a test in through the iam module, the way a client of the project does, and hands it the session: as the cookie the returned client carries on every request, and as the session id a gRPC call names with grpc.WithBearer.
|
Package iamtest logs a test in through the iam module, the way a client of the project does, and hands it the session: as the cookie the returned client carries on every request, and as the session id a gRPC call names with grpc.WithBearer. |