MCPcopy Index your code
hub / github.com/einride/aip-go

github.com/einride/aip-go @v0.86.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.86.3 ↗ · + Follow
1,045 symbols 2,688 edges 129 files 324 documented · 31% updated 4d agov0.86.3 · 2026-05-18★ 24214 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Go Reference

AIP Go

Go SDK for implementing Google API Improvement Proposals (AIP).

Generate AIP support code from proto

go install go.einride.tech/aip/cmd/protoc-gen-go-aip

Add to buf.gen.yaml:

version: v2
plugins:
  - local: protoc-gen-go-aip
    out: gen
    opt:
      - paths=source_relative

Run buf build to generate e.g. your_service_aip.go.

Library usage examples

go get -u go.einride.tech/aip

AIP-132 (Standard method: List)

```go package examplelibrary

import ( "context"

  "go.einride.tech/aip/pagination"
  "google.golang.org/genproto/googleapis/example/library/v1"
  "google.golang.org/grpc/codes"
  "google.golang.org/grpc/status"

)

func (s Server) ListShelves( ctx context.Context, request library.ListShelvesRequest, ) (*library.ListShelvesResponse, error) { // Handle request constraints. const ( maxPageSize = 1000 defaultPageSize = 100 ) switch { case request.PageSize < 0: return nil, status.Errorf(codes.InvalidArgument, "page size is negative") case request.PageSize == 0: request.PageSize = defaultPageSize case request.PageSize > maxPageSize: request.PageSize = maxPageSize } // Use pagination.PageToken for offset-based page tokens. pageToken, err := pagination.ParsePageToken(request) if err != nil { return nil, status.Errorf(codes.InvalidArgument, "invalid page token") } // Query the storage. result, err := s.Storage.ListShelves(ctx, &ListShelvesQuery{ Offset: pageToken.Offset, PageSize: request.GetPageSize(), }) if err != nil { return nil, err } // Build the response. response := &library.ListShelvesResponse{ Shelves: result.Shelves, } // Set the next page token. if result.HasNextPage { response.NextPageToken = pageToken.Next(request).String() } // Respond. return response, nil } ```

Extension points exported contracts — how you extend this code

BookMultiPatternResourceName (Interface)
(no doc) [17 implementers]
cmd/protoc-gen-go-aip/internal/genaip/testdata/test/multipattern/testdata_aip.go
Request (Interface)
Request is an interface for requests that support ordering. See: https://google.aip.dev/132#ordering (Standard methods:
ordering/request.go
Request (Interface)
Request is an interface for paginated request messages. See: https://google.aip.dev/158 (Pagination).
pagination/request.go
DeclarationOption (FuncType)
DeclarationOption configures Declarations.
filtering/declarations.go
Macro (FuncType)
Macro represents a function that can perform macro replacements on a filter expression.
filtering/macro.go
Request (Interface)
Request is an interface for gRPC requests that contain a standard AIP filter.
filtering/request.go
WalkFunc (FuncType)
WalkFunc is called for every expression while calling Walk. Return false to stop Walk.
filtering/walk.go
Matcher (FuncType)
Matcher returns true if the expr matches the predicate.
filtering/exprs/match.go

Core symbols most depended-on inside this repo

Text
called by 164
filtering/expr.go
DeclareIdent
called by 147
filtering/declarations.go
DeclareStandardFunctions
called by 96
filtering/declarations.go
String
called by 70
filtering/expr.go
NewFunctionOverload
called by 64
filtering/declarations.go
Equals
called by 57
filtering/expr.go
Segment
called by 54
resourcename/scanner.go
Int
called by 46
filtering/expr.go

Shape

Method 667
Function 267
Struct 85
Interface 14
TypeAlias 7
FuncType 5

Languages

Go100%

Modules by API surface

proto/gen/einride/example/freight/v1/freight_service.pb.go159 symbols
proto/gen/einride/example/freight/v1/freight_service_grpc.pb.go88 symbols
cmd/protoc-gen-go-aip/internal/genaip/testdata/test/originallysinglepattern/testdata_aip.go72 symbols
proto/gen/einride/example/syntax/v1/syntax.pb.go68 symbols
cmd/protoc-gen-go-aip/internal/genaip/testdata/test/multipattern/testdata_aip.go60 symbols
proto/gen/einride/example/syntax/v1/fieldbehaviors.pb.go43 symbols
proto/gen/einride/example/freight/v1/shipment.pb.go34 symbols
filtering/parser.go28 symbols
filtering/declarations.go22 symbols
cmd/protoc-gen-go-aip/internal/genaip/testdata/test/single/testdata_aip.go22 symbols
filtering/expr.go21 symbols
cmd/protoc-gen-go-aip/internal/genaip/resourcename.go20 symbols

For agents

$ claude mcp add aip-go \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact