Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/arcjet/gravity
/ functions
Functions
184 in github.com/arcjet/gravity
⨍
Functions
184
◇
Types & classes
44
↓ 42 callers
Method
tmp
(&mut self)
cmd/gravity/src/codegen/func.rs:79
↓ 12 callers
Method
pop_block
(&mut self)
cmd/gravity/src/codegen/func.rs:112
↓ 10 callers
Function
resolve_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 callers
Function
qualified_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 callers
Method
generate_host_function_builder
( &self, method: &InterfaceMethod, // The name of the parameter representing the inter
cmd/gravity/src/codegen/imports.rs:448
↓ 6 callers
Method
format_into
(self, tokens: &mut Tokens<Go>)
cmd/gravity/src/codegen/wasm.rs:25
↓ 6 callers
Function
newInstance
(t *testing.T)
examples/regressions/regressions_test.go:99
↓ 5 callers
Function
newInstance
(t *testing.T)
examples/variants/variants_test.go:118
↓ 4 callers
Method
Error
(ctx context.Context, msg string)
examples/basic/basic_test.go:15
↓ 4 callers
Method
analyze
(&self)
cmd/gravity/src/codegen/imports.rs:38
↓ 4 callers
Method
analyze_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 callers
Function
case_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 callers
Method
format_into
(self, tokens: &mut Tokens<Go>)
cmd/gravity/src/go/identifier.rs:76
↓ 4 callers
Method
format_into
(self, tokens: &mut Tokens<Go>)
cmd/gravity/src/go/result.rs:34
↓ 4 callers
Method
format_into
(self, tokens: &mut Tokens<Go>)
cmd/gravity/src/go/type.rs:140
↓ 4 callers
Method
generate_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 callers
Method
args
(&self)
cmd/gravity/src/codegen/func.rs:96
↓ 3 callers
Method
format_into
(self, tokens: &mut Tokens<Go>)
cmd/gravity/src/go/operand.rs:39
↓ 3 callers
Function
resolve_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 callers
Function
resolve_wasm_type
Resolves a Wasm type to a Go type.
cmd/gravity/src/lib.rs:95
↓ 2 callers
Method
analyze_type
(&self, type_id: TypeId)
cmd/gravity/src/codegen/imports.rs:142
↓ 2 callers
Function
case_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 callers
Function
create_test_world_with_interface
()
cmd/gravity/src/codegen/imports.rs:976
↓ 2 callers
Function
fooCmp
(a, b Foo)
examples/records/records_test.go:117
↓ 2 callers
Method
format_into
(self, tokens: &mut Tokens<Go>)
cmd/gravity/src/codegen/imports.rs:323
↓ 2 callers
Method
generate_type_definition
(&self, typ: &AnalyzedType, tokens: &mut Tokens<Go>)
cmd/gravity/src/codegen/imports.rs:370
↓ 2 callers
Method
generate_write_string
Generate the `writeString` helper function.
cmd/gravity/src/codegen/factory.rs:40
↓ 1 callers
Method
analyze_function
(&self, func: &Function)
cmd/gravity/src/codegen/imports.rs:246
↓ 1 callers
Method
analyze_interface
(&self, interface_id: InterfaceId)
cmd/gravity/src/codegen/imports.rs:75
↓ 1 callers
Method
analyze_interface_method
(&self, func: &Function, _interface_name: &str)
cmd/gravity/src/codegen/imports.rs:117
↓ 1 callers
Method
analyze_variant_case
(&self, variant_name: &str, case: &Case)
cmd/gravity/src/codegen/imports.rs:166
↓ 1 callers
Method
build_parameters
Build parameter list for factory constructor
cmd/gravity/src/codegen/factory.rs:151
↓ 1 callers
Method
chars
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 callers
Function
comment
Helper function to create a Go comment.
cmd/gravity/src/go/comment.rs:26
↓ 1 callers
Function
embed
Helper function to create an embed directive.
cmd/gravity/src/go/embed.rs:24
↓ 1 callers
Method
format_into
(self, tokens: &mut Tokens<Go>)
cmd/gravity/src/go/comment.rs:15
↓ 1 callers
Method
generate
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 callers
Method
generate_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 callers
Method
generate_factory
Generate the Factory struct, constructor, and methods.
cmd/gravity/src/codegen/factory.rs:73
↓ 1 callers
Method
generate_factory
Generates the factory and instantiate functions, including any required interfaces.
cmd/gravity/src/codegen/bindings.rs:75
↓ 1 callers
Method
generate_imports
Generates the imports for the bindings.
cmd/gravity/src/codegen/bindings.rs:63
↓ 1 callers
Method
generate_instance
Generate the Instance struct, and methods.
cmd/gravity/src/codegen/factory.rs:132
↓ 1 callers
Method
generate_interface_type
(&self, interface: &AnalyzedInterface, tokens: &mut Tokens<Go>)
cmd/gravity/src/codegen/imports.rs:341
↓ 1 callers
Method
generate_method_signature
(&self, method: &InterfaceMethod)
cmd/gravity/src/codegen/imports.rs:355
↓ 1 callers
Method
import_chains
Extract import chains for host module builders
cmd/gravity/src/codegen/imports.rs:289
↓ 1 callers
Method
include_wasm
Adds the given Wasm to the bindings.
cmd/gravity/src/codegen/bindings.rs:48
↓ 1 callers
Method
module_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 callers
Method
push_arg
(&mut self, value: &str)
cmd/gravity/src/codegen/func.rs:108
Method
Arch
(context.Context)
examples/iface-method-returns-string/example_test.go:15
Method
Debug
(ctx context.Context, msg string)
examples/basic/basic_test.go:12
Method
Double
(_ context.Context, value uint32)
examples/regressions/regressions_test.go:44
Method
GetStatus
(_ context.Context, key string)
examples/regressions/regressions_test.go:24
Method
Info
(ctx context.Context, msg string)
examples/basic/basic_test.go:13
Method
IsAllowed
(_ context.Context, email string)
examples/regressions/regressions_test.go:65
Method
IsEnabled
(_ context.Context, key string)
examples/regressions/regressions_test.go:20
Method
Lookup
(_ context.Context, ip string)
examples/regressions/regressions_test.go:91
Method
Os
(context.Context)
examples/iface-method-returns-string/example_test.go:14
Method
Ping
(_ context.Context)
examples/regressions/regressions_test.go:57
Method
Puts
(_ context.Context, msg string)
examples/iface-method-returns-string/example_test.go:16
Function
TestBasic
(t *testing.T)
examples/iface-method-returns-string/example_test.go:18
Function
TestBasic
(t *testing.T)
examples/basic/basic_test.go:23
Function
TestCheckEnabled
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
Function
TestCheckStatus
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
Function
TestChooseMany
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
Function
TestChoose_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
Function
TestClassify_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
Function
TestClassify_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
Function
TestCrossInterfaceEnumCollision
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
Function
TestDoubleValue
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
Function
TestImportCallbackOptionString
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
Function
TestNoOptionalPrimitiveCleanup
(t *testing.T)
examples/basic/basic_test.go:68
Function
TestNoPrimitiveCleanup
(t *testing.T)
examples/basic/basic_test.go:47
Function
TestRecord
(t *testing.T)
examples/records/records_test.go:8
Function
TestRecordFallibleError
(t *testing.T)
examples/records/records_test.go:85
Function
TestRecordFallibleSuccess
(t *testing.T)
examples/records/records_test.go:45
Function
TestResultPrimitiveCleanup
(t *testing.T)
examples/basic/basic_test.go:93
Function
TestRunPing
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
Function
TestTagAll
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
Function
Test_EnumInput
(t *testing.T)
examples/instructions/instructions_test.go:226
Function
Test_F32Roundtrip
(t *testing.T)
examples/instructions/instructions_test.go:174
Function
Test_F64Roundtrip
(t *testing.T)
examples/instructions/instructions_test.go:200
Function
Test_S16Roundtrip
(t *testing.T)
examples/instructions/instructions_test.go:90
Function
Test_S32Roundtrip
(t *testing.T)
examples/instructions/instructions_test.go:132
Function
Test_S8Roundtrip
(t *testing.T)
examples/instructions/instructions_test.go:48
Function
Test_U16Roundtrip
(t *testing.T)
examples/instructions/instructions_test.go:111
Function
Test_U32Roundtrip
(t *testing.T)
examples/instructions/instructions_test.go:153
Function
Test_U8Roundtrip
(t *testing.T)
examples/instructions/instructions_test.go:69
Method
Uppercase
(ctx context.Context, value string)
examples/basic/basic_test.go:19
Method
Verify
(_ context.Context, botID string)
examples/regressions/regressions_test.go:78
Method
Warn
(ctx context.Context, msg string)
examples/basic/basic_test.go:14
Method
as_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
Method
body
(&self)
cmd/gravity/src/codegen/func.rs:104
Method
check_bot_verified
(bot_id: String)
examples/regressions/src/lib.rs:42
Method
check_email_allowed
(email: String)
examples/regressions/src/lib.rs:34
Method
check_enabled
(key: String)
examples/regressions/src/lib.rs:14
Method
check_status
(key: String)
examples/regressions/src/lib.rs:18
Method
choose
(input: Config)
examples/variants/src/lib.rs:32
Method
choose_many
(input: Entities)
examples/variants/src/lib.rs:43
Method
classify
(input: String)
examples/variants/src/lib.rs:10
Function
cli_tests
()
cmd/gravity/tests/cli.rs:2
next →
1–100 of 184, ranked by callers