cloudflare

package
v2.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 9, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

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