cloudflare

package
v2.9.4 Latest Latest
Warning

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

Go to latest
Published: May 2, 2021 License: Apache-2.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cloudflare is a store implementation backed by cloudflare workers kv Note that the cloudflare workers KV API is eventually consistent.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Account

func Account(id string) store.Option

Account sets the cloudflare account id

func CacheTTL

func CacheTTL(ttl time.Duration) store.Option

CacheTTL sets the timeout in nanoseconds of the read/write cache

func Namespace

func Namespace(ns string) store.Option

Namespace sets the KV namespace

func NewStore

func NewStore(opts ...store.Option) store.Store

NewStore returns a cloudflare Store implementation. Account ID, Token and Namespace must either be passed as options or environment variables. If set as env vars we expect the following; CF_API_TOKEN to a cloudflare API token scoped to Workers KV. CF_ACCOUNT_ID to contain a string with your cloudflare account ID. KV_NAMESPACE_ID to contain the namespace UUID for your KV storage.

func Token

func Token(t string) store.Option

Token sets the cloudflare api token

Types

This section is empty.

Jump to

Keyboard shortcuts

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