MCPcopy Create free account

hub / github.com/arcjet/gravity / functions

Functions184 in github.com/arcjet/gravity

↓ 42 callersMethodtmp
(&mut self)
cmd/gravity/src/codegen/func.rs:79
↓ 12 callersMethodpop_block
(&mut self)
cmd/gravity/src/codegen/func.rs:112
↓ 10 callersFunctionresolve_type
Resolves a WIT type to a Go type. # Panics This function panics if: - The type definition cannot be found in the resolve context. - The type is sti
cmd/gravity/src/lib.rs:116
↓ 9 callersFunctionqualified_type_name
Returns a globally-unique kebab-case name suitable for deriving a Go identifier from a WIT type. WIT lets two interfaces declare types of the same nam
cmd/gravity/src/lib.rs:62
↓ 8 callersMethodgenerate_host_function_builder
( &self, method: &InterfaceMethod, // The name of the parameter representing the inter
cmd/gravity/src/codegen/imports.rs:448
↓ 6 callersMethodformat_into
(self, tokens: &mut Tokens<Go>)
cmd/gravity/src/codegen/wasm.rs:25
↓ 6 callersFunctionnewInstance
(t *testing.T)
examples/regressions/regressions_test.go:99
↓ 5 callersFunctionnewInstance
(t *testing.T)
examples/variants/variants_test.go:118
↓ 4 callersMethodError
(ctx context.Context, msg string)
examples/basic/basic_test.go:15
↓ 4 callersMethodanalyze
(&self)
cmd/gravity/src/codegen/imports.rs:38
↓ 4 callersMethodanalyze_type_definition
Analyze a type definition. Returns `None` for `Type::Id` aliases that just re-export an already-analyzed type.
cmd/gravity/src/codegen/imports.rs:187
↓ 4 callersFunctioncase_dispatch_kind
Detect the WIT shorthand `case-name(case-name)` where the payload is a named record sharing the case's name — the historical arcjet shape (`allow-emai
cmd/gravity/src/lib.rs:31
↓ 4 callersMethodformat_into
(self, tokens: &mut Tokens<Go>)
cmd/gravity/src/go/identifier.rs:76
↓ 4 callersMethodformat_into
(self, tokens: &mut Tokens<Go>)
cmd/gravity/src/go/result.rs:34
↓ 4 callersMethodformat_into
(self, tokens: &mut Tokens<Go>)
cmd/gravity/src/go/type.rs:140
↓ 4 callersMethodgenerate_function
Generate the Go function code for the given function. The signature is obtained by: - getting the function parameters from the `wit_parser::Function`
cmd/gravity/src/codegen/exports.rs:34
↓ 3 callersMethodargs
(&self)
cmd/gravity/src/codegen/func.rs:96
↓ 3 callersMethodformat_into
(self, tokens: &mut Tokens<Go>)
cmd/gravity/src/go/operand.rs:39
↓ 3 callersFunctionresolve_param_type
Like [`resolve_type`], but downgrades a top-level Variant to `interface{}` so existing call sites can keep passing the variant payload through `any`-t
cmd/gravity/src/lib.rs:211
↓ 3 callersFunctionresolve_wasm_type
Resolves a Wasm type to a Go type.
cmd/gravity/src/lib.rs:95
↓ 2 callersMethodanalyze_type
(&self, type_id: TypeId)
cmd/gravity/src/codegen/imports.rs:142
↓ 2 callersFunctioncase_dispatch_name
Kebab-case Go name for the type a variant case dispatches against in a type-switch.
cmd/gravity/src/lib.rs:45
↓ 2 callersFunctioncreate_test_world_with_interface
()
cmd/gravity/src/codegen/imports.rs:976
↓ 2 callersFunctionfooCmp
(a, b Foo)
examples/records/records_test.go:117
↓ 2 callersMethodformat_into
(self, tokens: &mut Tokens<Go>)
cmd/gravity/src/codegen/imports.rs:323
↓ 2 callersMethodgenerate_type_definition
(&self, typ: &AnalyzedType, tokens: &mut Tokens<Go>)
cmd/gravity/src/codegen/imports.rs:370
↓ 2 callersMethodgenerate_write_string
Generate the `writeString` helper function.
cmd/gravity/src/codegen/factory.rs:40
↓ 1 callersMethodanalyze_function
(&self, func: &Function)
cmd/gravity/src/codegen/imports.rs:246
↓ 1 callersMethodanalyze_interface
(&self, interface_id: InterfaceId)
cmd/gravity/src/codegen/imports.rs:75
↓ 1 callersMethodanalyze_interface_method
(&self, func: &Function, _interface_name: &str)
cmd/gravity/src/codegen/imports.rs:117
↓ 1 callersMethodanalyze_variant_case
(&self, variant_name: &str, case: &Case)
cmd/gravity/src/codegen/imports.rs:166
↓ 1 callersMethodbuild_parameters
Build parameter list for factory constructor
cmd/gravity/src/codegen/factory.rs:151
↓ 1 callersMethodchars
Returns an iterator over the characters of the underlying name. This provides access to the raw name without case transformations. # Returns An iter
cmd/gravity/src/go/identifier.rs:52
↓ 1 callersFunctioncomment
Helper function to create a Go comment.
cmd/gravity/src/go/comment.rs:26
↓ 1 callersFunctionembed
Helper function to create an embed directive.
cmd/gravity/src/go/embed.rs:24
↓ 1 callersMethodformat_into
(self, tokens: &mut Tokens<Go>)
cmd/gravity/src/go/comment.rs:15
↓ 1 callersMethodgenerate
Generate the bindings. This generates the imports (interfaces, types, functions), the factory and instance type, and the exports (functions).
cmd/gravity/src/codegen/bindings.rs:56
↓ 1 callersMethodgenerate_exports
Generates all exports for the world. Note: for now this only generates functions; types and interfaces are still TODO
cmd/gravity/src/codegen/bindings.rs:92
↓ 1 callersMethodgenerate_factory
Generate the Factory struct, constructor, and methods.
cmd/gravity/src/codegen/factory.rs:73
↓ 1 callersMethodgenerate_factory
Generates the factory and instantiate functions, including any required interfaces.
cmd/gravity/src/codegen/bindings.rs:75
↓ 1 callersMethodgenerate_imports
Generates the imports for the bindings.
cmd/gravity/src/codegen/bindings.rs:63
↓ 1 callersMethodgenerate_instance
Generate the Instance struct, and methods.
cmd/gravity/src/codegen/factory.rs:132
↓ 1 callersMethodgenerate_interface_type
(&self, interface: &AnalyzedInterface, tokens: &mut Tokens<Go>)
cmd/gravity/src/codegen/imports.rs:341
↓ 1 callersMethodgenerate_method_signature
(&self, method: &InterfaceMethod)
cmd/gravity/src/codegen/imports.rs:355
↓ 1 callersMethodimport_chains
Extract import chains for host module builders
cmd/gravity/src/codegen/imports.rs:289
↓ 1 callersMethodinclude_wasm
Adds the given Wasm to the bindings.
cmd/gravity/src/codegen/bindings.rs:48
↓ 1 callersMethodmodule_handle
The Go expression that resolves to the wasm `api.Module` in the current direction. Exports live on a Go-side instance struct (`i.module`); imports rec
cmd/gravity/src/codegen/func.rs:89
↓ 1 callersMethodpush_arg
(&mut self, value: &str)
cmd/gravity/src/codegen/func.rs:108
MethodArch
(context.Context)
examples/iface-method-returns-string/example_test.go:15
MethodDebug
(ctx context.Context, msg string)
examples/basic/basic_test.go:12
MethodDouble
(_ context.Context, value uint32)
examples/regressions/regressions_test.go:44
MethodGetStatus
(_ context.Context, key string)
examples/regressions/regressions_test.go:24
MethodInfo
(ctx context.Context, msg string)
examples/basic/basic_test.go:13
MethodIsAllowed
(_ context.Context, email string)
examples/regressions/regressions_test.go:65
MethodIsEnabled
(_ context.Context, key string)
examples/regressions/regressions_test.go:20
MethodLookup
(_ context.Context, ip string)
examples/regressions/regressions_test.go:91
MethodOs
(context.Context)
examples/iface-method-returns-string/example_test.go:14
MethodPing
(_ context.Context)
examples/regressions/regressions_test.go:57
MethodPuts
(_ context.Context, msg string)
examples/iface-method-returns-string/example_test.go:16
FunctionTestBasic
(t *testing.T)
examples/iface-method-returns-string/example_test.go:18
FunctionTestBasic
(t *testing.T)
examples/basic/basic_test.go:23
FunctionTestCheckEnabled
TestCheckEnabled tests regression 1: import function returning bool. The Wasm guest calls the imported is-enabled function and returns the bool result
examples/regressions/regressions_test.go:132
FunctionTestCheckStatus
TestCheckStatus tests regression 1: import function returning enum. This is the exact pattern that was failing in Arcjet's bot bindings, where verify-
examples/regressions/regressions_test.go:147
FunctionTestChooseMany
TestChooseMany exercises a variant whose payload is `list<variant>` (e.g. `allow-all(list<entity>)`). Gravity must wrap the list in a `EntitiesAllowAl
examples/variants/variants_test.go:96
FunctionTestChoose_DirectRecordDispatch
TestChoose_DirectRecordDispatch exercises the WIT shorthand `case(case)` — when a variant case's only payload is a named record sharing its name, grav
examples/variants/variants_test.go:68
FunctionTestClassify_PayloadCase
TestClassify_PayloadCase exercises lifting a payload-bearing case where the payload is a primitive — the wrapper carries it in `Value`. Regression: th
examples/variants/variants_test.go:22
FunctionTestClassify_UnitCase
TestClassify_UnitCase exercises lifting a unit-case variant returned from the guest. The wrapper struct must be zero-sized and the type switch on the
examples/variants/variants_test.go:10
FunctionTestCrossInterfaceEnumCollision
TestCrossInterfaceEnumCollision covers regression 4. Both `email-checker` and `bot-verifier` define `enum validator-response` inside the same world; w
examples/regressions/regressions_test.go:215
FunctionTestDoubleValue
TestDoubleValue tests regression 2: import function with u32 parameters. Before the fix, gravity generated api.EncodeU32()/api.DecodeU32() for I32From
examples/regressions/regressions_test.go:171
FunctionTestImportCallbackOptionString
TestImportCallbackOptionString covers regression 5. The `ip-source` import returns `option<string>`. Lowering it into wasm memory must run against the
examples/regressions/regressions_test.go:253
FunctionTestNoOptionalPrimitiveCleanup
(t *testing.T)
examples/basic/basic_test.go:68
FunctionTestNoPrimitiveCleanup
(t *testing.T)
examples/basic/basic_test.go:47
FunctionTestRecord
(t *testing.T)
examples/records/records_test.go:8
FunctionTestRecordFallibleError
(t *testing.T)
examples/records/records_test.go:85
FunctionTestRecordFallibleSuccess
(t *testing.T)
examples/records/records_test.go:45
FunctionTestResultPrimitiveCleanup
(t *testing.T)
examples/basic/basic_test.go:93
FunctionTestRunPing
TestRunPing tests regression 3: import function with zero WIT parameters. The pinger.ping import takes no arguments (only the implicit ctx and mod par
examples/regressions/regressions_test.go:200
FunctionTestTagAll
TestTagAll exercises: - returning a list of records from the guest (list lift of record) - records that contain a variant field (variant lift inside r
examples/variants/variants_test.go:39
FunctionTest_EnumInput
(t *testing.T)
examples/instructions/instructions_test.go:226
FunctionTest_F32Roundtrip
(t *testing.T)
examples/instructions/instructions_test.go:174
FunctionTest_F64Roundtrip
(t *testing.T)
examples/instructions/instructions_test.go:200
FunctionTest_S16Roundtrip
(t *testing.T)
examples/instructions/instructions_test.go:90
FunctionTest_S32Roundtrip
(t *testing.T)
examples/instructions/instructions_test.go:132
FunctionTest_S8Roundtrip
(t *testing.T)
examples/instructions/instructions_test.go:48
FunctionTest_U16Roundtrip
(t *testing.T)
examples/instructions/instructions_test.go:111
FunctionTest_U32Roundtrip
(t *testing.T)
examples/instructions/instructions_test.go:153
FunctionTest_U8Roundtrip
(t *testing.T)
examples/instructions/instructions_test.go:69
MethodUppercase
(ctx context.Context, value string)
examples/basic/basic_test.go:19
MethodVerify
(_ context.Context, botID string)
examples/regressions/regressions_test.go:78
MethodWarn
(ctx context.Context, msg string)
examples/basic/basic_test.go:14
Methodas_string
Returns the primary value of the operand. For single values and literals, returns the value itself. For multi-value tuples, returns the first value.
cmd/gravity/src/go/operand.rs:28
Methodbody
(&self)
cmd/gravity/src/codegen/func.rs:104
Methodcheck_bot_verified
(bot_id: String)
examples/regressions/src/lib.rs:42
Methodcheck_email_allowed
(email: String)
examples/regressions/src/lib.rs:34
Methodcheck_enabled
(key: String)
examples/regressions/src/lib.rs:14
Methodcheck_status
(key: String)
examples/regressions/src/lib.rs:18
Methodchoose
(input: Config)
examples/variants/src/lib.rs:32
Methodchoose_many
(input: Entities)
examples/variants/src/lib.rs:43
Methodclassify
(input: String)
examples/variants/src/lib.rs:10
Functioncli_tests
()
cmd/gravity/tests/cli.rs:2
next →1–100 of 184, ranked by callers