Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type KVNamespace ¶ added in v0.3.0
type KVNamespace interface {
GetString(key string, opts *KVNamespaceGetOptions) (string, error)
GetReader(key string, opts *KVNamespaceGetOptions) (io.Reader, error)
List(opts *KVNamespaceListOptions) (*KVNamespaceListResult, error)
PutString(key string, value string, opts *KVNamespacePutOptions) error
PutReader(key string, value io.Reader, opts *KVNamespacePutOptions) error
Delete(key string) error
}
KVNamespace represents interface of Cloudflare Worker's KV namespace instance. - https://developers.cloudflare.com/workers/runtime-apis/kv/ - https://github.com/cloudflare/workers-types/blob/3012f263fb1239825e5f0061b267c8650d01b717/index.d.ts#L850
func NewKVNamespace ¶ added in v0.3.0
func NewKVNamespace(varName string) (KVNamespace, error)
NewKVNamespace returns KVNamespace for given variable name. * variable name must be defined in wrangler.toml as kv_namespace's binding. * if the given variable name doesn't exist on global object, returns error.
type KVNamespaceGetOptions ¶ added in v0.3.0
type KVNamespaceGetOptions struct {
CacheTTL int
}
KVNamespaceGetOptions represents Cloudflare KV namespace get options. * https://github.com/cloudflare/workers-types/blob/3012f263fb1239825e5f0061b267c8650d01b717/index.d.ts#L930
type KVNamespaceListKey ¶ added in v0.3.0
type KVNamespaceListKey struct {
Name string
// Expiration is an expiration of KV value cache. The value `0` means no expiration.
Expiration int
}
KVNamespaceListKey represents Cloudflare KV namespace list key. * https://github.com/cloudflare/workers-types/blob/3012f263fb1239825e5f0061b267c8650d01b717/index.d.ts#L940
type KVNamespaceListOptions ¶ added in v0.3.0
KVNamespaceListOptions represents Cloudflare KV namespace list options. * https://github.com/cloudflare/workers-types/blob/3012f263fb1239825e5f0061b267c8650d01b717/index.d.ts#L946
type KVNamespaceListResult ¶ added in v0.3.0
type KVNamespaceListResult struct {
Keys []*KVNamespaceListKey
ListComplete bool
Cursor string
}
KVNamespaceListResult represents Cloudflare KV namespace list result. * https://github.com/cloudflare/workers-types/blob/3012f263fb1239825e5f0061b267c8650d01b717/index.d.ts#L952
type KVNamespacePutOptions ¶ added in v0.3.0
KVNamespacePutOptions represents Cloudflare KV namespace put options. * https://github.com/cloudflare/workers-types/blob/3012f263fb1239825e5f0061b267c8650d01b717/index.d.ts#L958
type R2Bucket ¶ added in v0.2.0
type R2Bucket interface {
Head(key string) (*R2Object, error)
Get(key string) (*R2Object, error)
Put(key string, value io.ReadCloser, opts *R2PutOptions) (*R2Object, error)
Delete(key string) error
List() (*R2Objects, error)
}
R2Bucket represents interface of Cloudflare Worker's R2 Bucket instance. - https://developers.cloudflare.com/r2/runtime-apis/#bucket-method-definitions - https://github.com/cloudflare/workers-types/blob/3012f263fb1239825e5f0061b267c8650d01b717/index.d.ts#L1006
func NewR2Bucket ¶ added in v0.2.0
NewR2Bucket returns R2Bucket for given variable name. * variable name must be defined in wrangler.toml.
* if the given variable name doesn't exist on global object, returns error.
type R2HTTPMetadata ¶ added in v0.2.0
type R2HTTPMetadata struct {
ContentType string
ContentLanguage string
ContentDisposition string
ContentEncoding string
CacheControl string
CacheExpiry time.Time
}
R2HTTPMetadata represents metadata of R2Object. * https://github.com/cloudflare/workers-types/blob/3012f263fb1239825e5f0061b267c8650d01b717/index.d.ts#L1053
type R2Object ¶ added in v0.2.0
type R2Object struct {
Key string
Version string
Size int
ETag string
HTTPETag string
Uploaded time.Time
HTTPMetadata R2HTTPMetadata
CustomMetadata map[string]string
// Body is a body of R2Object.
// This value is nil for the result of the `Head` or `Put` method.
Body io.Reader
// contains filtered or unexported fields
}
R2Object represents Cloudflare R2 object. * https://github.com/cloudflare/workers-types/blob/3012f263fb1239825e5f0061b267c8650d01b717/index.d.ts#L1094
type R2Objects ¶ added in v0.2.0
type R2Objects struct {
Objects []*R2Object
Truncated bool
// Cursor indicates next cursor of R2Objects.
// * This becomes empty string if cursor doesn't exist.
Cursor string
DelimitedPrefixes []string
}
R2Objects represents Cloudflare R2 objects. * https://github.com/cloudflare/workers-types/blob/3012f263fb1239825e5f0061b267c8650d01b717/index.d.ts#L1121
type R2PutOptions ¶ added in v0.2.0
type R2PutOptions struct {
HTTPMetadata R2HTTPMetadata
CustomMetadata map[string]string
MD5 string
}
R2PutOptions represents Cloudflare R2 put options. * https://github.com/cloudflare/workers-types/blob/3012f263fb1239825e5f0061b267c8650d01b717/index.d.ts#L1128
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
_examples
|
|
|
browser
module
|
|
|
cache
module
|
|
|
d1-blog-server
module
|
|
|
durable-object-counter
module
|
|
|
env
module
|
|
|
fetch
module
|
|
|
fetch-event
module
|
|
|
hello
module
|
|
|
incoming
module
|
|
|
kv-counter
module
|
|
|
multiple-handlers
module
|
|
|
mysql-blog-server
module
|
|
|
pages-functions
module
|
|
|
queues
module
|
|
|
r2-image-server
module
|
|
|
service-bindings
module
|
|
|
simple-json-server
module
|
|
|
sockets
module
|
|
|
_templates
|
|
|
cloudflare/cron-go
module
|
|
|
cloudflare/cron-tinygo
module
|
|
|
cloudflare/worker-go
module
|
|
|
cloudflare/worker-tinygo
module
|
|
|
examples
|
|
|
d1-blog-server
module
|
|
|
simple-json-server
module
|