Documentation
¶
Index ¶
- func GetBinding(name string) js.Value
- func Getenv(name string) string
- func NewKVNamespace(varName string) (*kv.Namespace, error)
- func PassThroughOnException()
- func WaitUntil(task func())
- type DurableObjectId
- type DurableObjectNamespace
- type DurableObjectStub
- type KVNamespace
- type KVNamespaceGetOptions
- type KVNamespaceListKey
- type KVNamespaceListOptions
- type KVNamespaceListResult
- type KVNamespacePutOptions
- type R2Bucket
- type R2HTTPMetadata
- type R2Object
- type R2Objects
- type R2PutOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBinding ¶ added in v0.12.1
GetBinding gets a value of an environment binding.
- https://developers.cloudflare.com/workers/platform/bindings/about-service-bindings/
- This function panics when a runtime context is not found.
func Getenv ¶ added in v0.7.0
Getenv gets a value of an environment variable.
- https://developers.cloudflare.com/workers/platform/environment-variables/
- This function panics when a runtime context is not found.
func NewKVNamespace ¶
NewKVNamespace returns KVNamespace for given variable name. Deprecated: Use kv.NewNamespace instead.
func PassThroughOnException ¶ added in v0.13.0
func PassThroughOnException()
PassThroughOnException prevents a runtime error response when the Worker script throws an unhandled exception. Instead, the request forwards to the origin server as if it had not gone through the worker. see: https://developers.cloudflare.com/workers/runtime-apis/fetch-event/#passthroughonexception
func WaitUntil ¶ added in v0.11.0
func WaitUntil(task func())
WaitUntil extends the lifetime of the "fetch" event. It accepts an asynchronous task which the Workers runtime will execute before the handler terminates but without blocking the response. see: https://developers.cloudflare.com/workers/runtime-apis/fetch-event/#waituntil
Types ¶
type DurableObjectId ¶ added in v0.9.0
type DurableObjectId struct {
// contains filtered or unexported fields
}
DurableObjectId represents an identifier for a durable object.
type DurableObjectNamespace ¶ added in v0.9.0
type DurableObjectNamespace struct {
// contains filtered or unexported fields
}
DurableObjectNamespace represents the namespace of the durable object.
func NewDurableObjectNamespace ¶ added in v0.9.0
func NewDurableObjectNamespace(varName string) (*DurableObjectNamespace, error)
NewDurableObjectNamespace returns the namespace for the `varName` binding.
This binding must be defined in the `wrangler.toml` file. The method will return an `error` when there is no binding defined by `varName`.
func (*DurableObjectNamespace) Get ¶ added in v0.9.0
func (ns *DurableObjectNamespace) Get(id *DurableObjectId) (*DurableObjectStub, error)
Get obtains the durable object stub for `id`.
https://developers.cloudflare.com/workers/runtime-apis/durable-objects/#obtaining-an-object-stub
func (*DurableObjectNamespace) IdFromName ¶ added in v0.9.0
func (ns *DurableObjectNamespace) IdFromName(name string) *DurableObjectId
IdFromName returns a `DurableObjectId` for the given `name`.
https://developers.cloudflare.com/workers/runtime-apis/durable-objects/#deriving-ids-from-names
type DurableObjectStub ¶ added in v0.9.0
type DurableObjectStub struct {
// contains filtered or unexported fields
}
DurableObjectStub represents the stub to communicate with the durable object.
func (*DurableObjectStub) Fetch ¶ added in v0.9.0
Fetch calls the durable objects `fetch()` method.
https://developers.cloudflare.com/workers/runtime-apis/durable-objects/#sending-http-requests
type KVNamespace ¶
KVNamespace represents interface of Cloudflare Worker's KV namespace instance. Deprecated: Use kv.Namespace instead.
type KVNamespaceGetOptions ¶
type KVNamespaceGetOptions = kv.GetOptions
KVNamespaceGetOptions represents Cloudflare KV namespace get options. Deprecated: Use kv.GetOptions instead.
type KVNamespaceListKey ¶
KVNamespaceListKey represents Cloudflare KV namespace list key. Deprecated: Use kv.ListKey instead.
type KVNamespaceListOptions ¶
type KVNamespaceListOptions = kv.ListOptions
KVNamespaceListOptions represents Cloudflare KV namespace list options. Deprecated: Use kv.ListOptions instead.
type KVNamespaceListResult ¶
type KVNamespaceListResult = kv.ListResult
KVNamespaceListResult represents Cloudflare KV namespace list result. Deprecated: Use kv.ListResult instead.
type KVNamespacePutOptions ¶
type KVNamespacePutOptions = kv.PutOptions
KVNamespacePutOptions represents Cloudflare KV namespace put options. Deprecated: Use kv.PutOptions instead.
type R2Bucket ¶
R2Bucket represents interface of Cloudflare Worker's R2 Bucket instance. Deprecated: use r2.Bucket instead.
func NewR2Bucket ¶
NewR2Bucket returns R2Bucket for given variable name. Deprecated: use r2.NewBucket instead.
type R2HTTPMetadata ¶
type R2HTTPMetadata = r2.HTTPMetadata
R2HTTPMetadata represents metadata of R2Object. Deprecated: use r2.HTTPMetadata instead.
type R2PutOptions ¶
type R2PutOptions = r2.PutOptions
R2PutOptions represents Cloudflare R2 put options. Deprecated: use r2.PutOptions instead.