tag

package
v0.0.0-...-0e3259e Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2020 License: MIT Imports: 6 Imported by: 4

Documentation

Overview

Package tag "Every package should have a package comment, a block comment preceding the package clause. For multi-file packages, the package comment only needs to be present in one file, and any one will do. The package comment should introduce the package and provide information relevant to the package as a whole. It will appear first on the godoc page and should set up the detailed documentation that follows.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFindTag = errors.New("Error while getting tag")
)

Errors

Functions

func Delete

func Delete(ctx context.Context, ek string) error

Delete removes the entity and all the corresponding "tagUser" entities in a transaction by the provided encoded entity key and returns an error.

func GetAllKeysOnly

func GetAllKeysOnly(ctx context.Context) ([]*datastore.Key, error)

GetAllKeysOnly returns all the entity keys as a slice and an error.

Types

type Tag

type Tag struct {
	ID        string    `datastore:"-"`
	ContextID string    `datastore:"-" json:"contextID"`
	Created   time.Time `json:"created"`
}

Tag is an user profession. Key's stringID is encoded "Context" key. And the "ContextID" is an encoded "Context" key for multilang usage purpose.

func Put

func Put(ctx context.Context, t *Tag) (*Tag, error)

Put puts and returns an entity, and also returns an error.

type Tags

type Tags map[string]*Tag

Tags is a map of *Tag with encoded key of Tag as key.

func GetMulti

func GetMulti(ctx context.Context, kx interface{}) (Tags, error)

GetMulti returns corresponding entities if keys provided. Otherwise returns limited entitities from the given cursor. If limit is nil default limit will be used.

func PutAndGetMulti

func PutAndGetMulti(s *session.Session, t *Tag) (Tags, error)

PutAndGetMulti is a transaction which puts the posted item first and then gets entities by the given limit.

Jump to

Keyboard shortcuts

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