api

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeleteResponse

type DeleteResponse struct {
	Data struct {
		Deleted      bool   `json:"deleted"`
		Id           string `json:"id"`
		LastModified int64  `json:"last_modified"`
	} `json:"data"`
}

type Deleter

type Deleter interface {
	Delete() string
}

type Getter

type Getter interface {
	Get() string
}

type Patcher

type Patcher interface {
	Patch() string
}

type Payload

type Payload struct {
	Data        interface{}        `json:"data"`
	Permissions *authz.Permissions `json:"permissions,omitempty"`
}

func NewPayload

func NewPayload(data interface{}, perms *authz.Permissions) *Payload

type Poster

type Poster interface {
	Post() string
}

type Record

type Record struct {
	Id           string `json:"id,omitempty"`
	LastModified uint64 `json:"last_modified,omitempty"`
}

Every Record in Kinto has attached to it an ID and last-modified data. The best way to use this struct is to embed a pointer to it within your own schema.

type LegoSet struct {
    branding string
    legos    []Lego
    *api.Record
}

This enables you to leave the Kinto metadata out in your in code while receiving it in full from Kinto when using your struct as a serde target.

starWars := NewLegoSet(...)
fmt.Println(starWars.Record)
client.NewRecord(&starWars)
fmt.Println(starWars.Record.LastModified)

For more details see https://docs.kinto-storage.org/en/stable/api/1.x/records.html

func (*Record) ID

func (r *Record) ID() string

type Recorded

type Recorded interface {
	ID() string
}

type Resourcer

type Resourcer interface {
	Resource() string
}

A Resourcer returns the REST API resource for accessing a given endpoint. The returned string should fulfill all paths BEYOND the base path and "rest" resource (proto>://<hostname>/rest).

E.G. If we are bucket a resource at "https://firefox.settings.services.mozilla.com/v1" then this method should return "/buckets/<name>"

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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