Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/LeenHawk/sgproxy
/ functions
Functions
165 in github.com/LeenHawk/sgproxy
⨍
Functions
165
◇
Types & classes
27
↓ 19 callers
Function
now_unix_ms
()
src/state.rs:32
↓ 18 callers
Function
clean_opt_owned
(value: Option<String>)
src/config.rs:190
↓ 13 callers
Function
save_doc
(storage: &Storage, doc: &DurableStateDoc)
src/state.rs:26
↓ 12 callers
Function
load_doc
(storage: &Storage)
src/state.rs:17
↓ 11 callers
Method
authorize
(&self, req: &Request)
src/do_state.rs:110
↓ 7 callers
Function
collect_beta_values
(raw: &str, target: &mut Vec<String>, allow_context_1m: bool)
src/proxy.rs:329
↓ 7 callers
Method
normalize
(&mut self, now: u64)
src/config.rs:198
↓ 6 callers
Function
normalize_claudecode_sampling
(body: &mut Value)
src/proxy.rs:506
↓ 6 callers
Function
record_invalid_auth
(doc: &mut DurableStateDoc, id: &str, now: u64, message: String)
src/state.rs:189
↓ 5 callers
Function
current_credential
(doc: &DurableStateDoc, id: &str)
src/do_state.rs:785
↓ 5 callers
Function
insert_oauth_state
(doc: &mut DurableStateDoc, state: StoredOAuthState)
src/state.rs:262
↓ 4 callers
Function
apply_claudecode_metadata_user_id
(body: &mut Value, credential: &CredentialConfig)
src/proxy.rs:528
↓ 4 callers
Function
apply_magic_string_cache_control_triggers
(body: &mut Value)
src/proxy.rs:914
↓ 4 callers
Function
canonicalize_claude_body
(body: &mut Value)
src/proxy.rs:846
↓ 4 callers
Function
is_claudecode_billing_header_block
(block: &Value)
src/proxy.rs:826
↓ 4 callers
Method
refresh_credential
( &self, doc: &mut DurableStateDoc, credential: &CredentialConfig, force: bool
src/do_state.rs:587
↓ 4 callers
Function
sample_oauth_state
(state_id: &str, channel: ChannelKind)
src/state.rs:315
↓ 4 callers
Function
send_request
( method: Method, url: &str, headers: Headers, body: Option<JsValue>, )
src/oauth.rs:477
↓ 4 callers
Function
upsert_credential
( doc: &mut DurableStateDoc, input: CredentialUpsertInput, forced_id: Option<&str>, forced_cha
src/state.rs:80
↓ 3 callers
Function
apply_claudecode_billing_header_system_block
(body: &mut Value, version: String)
src/proxy.rs:657
↓ 3 callers
Function
block_supports_direct_cache_control
(block_map: &serde_json::Map<String, Value>)
src/proxy.rs:1048
↓ 3 callers
Function
bucket_reset_or
(resets_at: &Option<String>, fallback: u64)
src/state.rs:399
↓ 3 callers
Method
build_usage_payload
( &self, doc: &mut DurableStateDoc, only_id: Option<&str>, )
src/do_state.rs:715
↓ 3 callers
Function
fetch_oauth_profile
(access_token: &str)
src/oauth.rs:237
↓ 3 callers
Function
flatten_system_text_before_cache_control
(body: &mut Value)
src/proxy.rs:687
↓ 3 callers
Function
header_equals
(header_value: &F, name: &str, expected: &str)
src/proxy.rs:304
↓ 3 callers
Function
json_error
(status: u16, message: &str)
src/do_state.rs:829
↓ 3 callers
Function
json_text_block
(text: &str)
src/proxy.rs:907
↓ 3 callers
Function
non_empty_owned
(value: &str)
src/proxy.rs:621
↓ 3 callers
Function
parse_query_value
(raw: Option<&str>, key: &str)
src/oauth.rs:547
↓ 3 callers
Function
parse_usage_bucket
(bucket: UsageBucketPayload)
src/oauth.rs:452
↓ 3 callers
Function
record_transient
(doc: &mut DurableStateDoc, id: &str, now: u64, message: String)
src/state.rs:198
↓ 3 callers
Function
sample_credential
()
src/proxy.rs:1064
↓ 2 callers
Function
apply_magic_trigger_to_block
( block_map: &mut serde_json::Map<String, Value>, remaining_slots: &mut usize, )
src/proxy.rs:954
↓ 2 callers
Function
apply_magic_trigger_to_content
(content: &mut Value, remaining_slots: &mut usize)
src/proxy.rs:939
↓ 2 callers
Function
build_upstream_headers
( original: &Headers, access_token: &str, allow_context_1m: bool, )
src/proxy.rs:107
↓ 2 callers
Function
canonicalize_claude_blocks
(blocks: &mut Vec<Value>)
src/proxy.rs:898
↓ 2 callers
Function
clean_opt_str
(value: &str)
src/oauth.rs:521
↓ 2 callers
Function
count_cache_controls_in_content
(content: &Value)
src/proxy.rs:1029
↓ 2 callers
Function
default_claude_headers
()
src/oauth.rs:470
↓ 2 callers
Function
ensure_channel_credential
(doc: &DurableStateDoc, channel: ChannelKind, id: &str)
src/do_state.rs:798
↓ 2 callers
Function
exact_usage_status
( usage: &CredentialUsageSnapshot, now: u64, )
src/state.rs:365
↓ 2 callers
Function
extract_inline_query_value
(raw: &str, key: &str)
src/oauth.rs:577
↓ 2 callers
Function
extract_value_from_text
(raw: &str, key: &str)
src/oauth.rs:562
↓ 2 callers
Function
fetch_claudecode_usage
(access_token: &str)
src/oauth.rs:264
↓ 2 callers
Function
first_text_from_claude_block
(block: &Value)
src/proxy.rs:785
↓ 2 callers
Function
is_hop_by_hop
(name: &str)
src/proxy.rs:357
↓ 2 callers
Function
maybe_refresh_access_token
( credential: &CredentialConfig, )
src/oauth.rs:231
↓ 2 callers
Function
parse_rate_limit_reset
(raw: &str)
src/proxy.rs:319
↓ 2 callers
Function
percent_decode_lossy
(value: &str)
src/oauth.rs:632
↓ 2 callers
Function
proxy_request
( mut req: Request, credential: &CredentialConfig, )
src/proxy.rs:34
↓ 2 callers
Function
record_rate_limited
( doc: &mut DurableStateDoc, id: &str, now: u64, usage: Option<&CredentialUsageSnapshot>,
src/state.rs:205
↓ 2 callers
Function
render_index
(mode: &str)
src/lib.rs:28
↓ 2 callers
Function
request_can_have_body
(req: &Request)
src/proxy.rs:436
↓ 2 callers
Method
resolve_credential_input
( &self, input: CredentialUpsertInput, forced_id: Option<&str>, doc: &DurableS
src/do_state.rs:389
↓ 2 callers
Function
send_upstream_request
( upstream_url: &str, method: &worker::Method, headers: Headers, body: Option<&[u8]>, )
src/proxy.rs:157
↓ 2 callers
Function
set_bucket_from_headers
( header_value: &F, utilization_name: &str, reset_name: &str, utilization_pct: &mut Option<u32
src/proxy.rs:282
↓ 2 callers
Method
set_enabled
(&self, id: &str, enabled: bool)
src/do_state.rs:200
↓ 2 callers
Function
take_oauth_state
( doc: &mut DurableStateDoc, channel: ChannelKind, requested_state: Option<&str>, )
src/state.rs:268
↓ 2 callers
Function
usage_auth_failed
(message: &str)
src/do_state.rs:793
↓ 1 callers
Function
apply_1m_probe_result
( doc: &mut DurableStateDoc, id: &str, disable_sonnet_1m: bool, disable_opus_1m: bool, )
src/state.rs:162
↓ 1 callers
Function
apply_refreshed_credential
( doc: &mut DurableStateDoc, credential: &CredentialConfig, refreshed: RefreshedCredential, )
src/do_state.rs:752
↓ 1 callers
Function
bearer_token
(headers: &Headers)
src/do_state.rs:822
↓ 1 callers
Function
block_has_cache_control
(block: &Value)
src/proxy.rs:762
↓ 1 callers
Function
block_has_direct_cache_control
(block: &Value)
src/proxy.rs:1042
↓ 1 callers
Function
block_text
(block: &Value)
src/proxy.rs:768
↓ 1 callers
Function
build_claude_authorize_url
( redirect_uri: &str, scope: &str, code_challenge: &str, state: &str, )
src/oauth.rs:491
↓ 1 callers
Function
build_claudecode_billing_header_text
(body: &Value, version: &str)
src/proxy.rs:732
↓ 1 callers
Function
build_upstream_url
(req: &Request)
src/proxy.rs:99
↓ 1 callers
Function
build_usage_view
( credential: &CredentialConfig, usage: CredentialUsageSnapshot, now: u64, )
src/state.rs:242
↓ 1 callers
Function
cache_control_ephemeral
(ttl: Option<&'static str>)
src/proxy.rs:996
↓ 1 callers
Function
canonicalize_claude_content
(content: &mut Value)
src/proxy.rs:883
↓ 1 callers
Function
canonicalize_claude_message
(message: &mut Value)
src/proxy.rs:873
↓ 1 callers
Function
canonicalize_claude_system
(system: &mut Value)
src/proxy.rs:862
↓ 1 callers
Function
claudecode_1m_enabled_for_credential
( credential: &CredentialConfig, target: Option<&ClaudeCode1mTarget>, )
src/proxy.rs:454
↓ 1 callers
Function
claudecode_billing_version_hash
(message_text: &str, version: &str)
src/proxy.rs:796
↓ 1 callers
Function
clone_request
(req: &Request)
src/do_state.rs:789
↓ 1 callers
Method
create_credential
(&self, payload: CredentialUpsertInput)
src/do_state.rs:168
↓ 1 callers
Function
delete_credential
(doc: &mut DurableStateDoc, id: &str)
src/state.rs:143
↓ 1 callers
Method
delete_credential
(&self, id: &str)
src/do_state.rs:208
↓ 1 callers
Function
derive_rate_limited_status
( usage: &CredentialUsageSnapshot, now: u64, )
src/state.rs:301
↓ 1 callers
Function
exchange_claudecode_code_for_tokens
( stored_state: &StoredOAuthState, code: &str, )
src/oauth.rs:190
↓ 1 callers
Function
existing_cache_breakpoint_count
(root: &serde_json::Map<String, Value>)
src/proxy.rs:1006
↓ 1 callers
Function
extract_labeled_value
(raw: &str, key: &str)
src/oauth.rs:592
↓ 1 callers
Function
extract_manual_code
(raw: &str)
src/oauth.rs:612
↓ 1 callers
Function
extract_rate_limit_usage
( headers: &Headers, status_code: u16, )
src/proxy.rs:184
↓ 1 callers
Function
extract_rate_limit_usage_values
( status_code: u16, header_value: F, )
src/proxy.rs:198
↓ 1 callers
Method
fetch_usage_snapshot
( &self, doc: &mut DurableStateDoc, credential: &CredentialConfig, )
src/do_state.rs:608
↓ 1 callers
Function
filter_response_headers
(original: &Headers)
src/proxy.rs:173
↓ 1 callers
Function
first_claudecode_user_text
(body: &Value)
src/proxy.rs:745
↓ 1 callers
Function
first_message_session_seed
(body: &Value)
src/proxy.rs:606
↓ 1 callers
Function
first_usable
( credentials: &[CredentialConfig], channel: ChannelKind, now: u64, )
src/state.rs:65
↓ 1 callers
Function
generate_code_challenge
(code_verifier: &str)
src/oauth.rs:542
↓ 1 callers
Function
generate_code_verifier
(len: usize)
src/oauth.rs:536
↓ 1 callers
Function
generate_oauth_state
()
src/oauth.rs:530
↓ 1 callers
Method
get_usage
(&self, id: &str)
src/do_state.rs:139
↓ 1 callers
Function
has_context_1m_beta
(headers: &Headers)
src/proxy.rs:348
↓ 1 callers
Function
is_context_1m_beta
(value: &str)
src/proxy.rs:344
↓ 1 callers
Function
js_utf16_unit_char
(unit: u16)
src/proxy.rs:816
↓ 1 callers
Method
list_credentials
(&self)
src/do_state.rs:156
next →
1–100 of 165, ranked by callers