cloudflare

package
v0.33.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2026 License: MIT Imports: 8 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBinding added in v0.12.1

func GetBinding(name string) js.Value

GetBinding gets a value of an environment binding.

func Getenv added in v0.7.0

func Getenv(name string) string

Getenv gets a value of an environment variable.

func NewKVNamespace

func NewKVNamespace(varName string) (*kv.Namespace, error)

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

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

func (s *DurableObjectStub) Fetch(req *http.Request) (*http.Response, error)

Fetch calls the durable objects `fetch()` method.

https://developers.cloudflare.com/workers/runtime-apis/durable-objects/#sending-http-requests

type KVNamespace

type KVNamespace = kv.Namespace

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

type KVNamespaceListKey = kv.ListKey

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

type R2Bucket = r2.Bucket

R2Bucket represents interface of Cloudflare Worker's R2 Bucket instance. Deprecated: use r2.Bucket instead.

func NewR2Bucket

func NewR2Bucket(varName string) (*R2Bucket, error)

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 R2Object

type R2Object = r2.Object

R2Object represents Cloudflare R2 object. Deprecated: use r2.Object instead.

type R2Objects

type R2Objects = r2.Objects

R2Objects represents Cloudflare R2 objects. Deprecated: use r2.Objects instead.

type R2PutOptions

type R2PutOptions = r2.PutOptions

R2PutOptions represents Cloudflare R2 put options. Deprecated: use r2.PutOptions instead.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL