roleType

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: 5 Imported by: 2

Documentation

Overview

Package roleType "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

This section is empty.

Functions

func Delete

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

Delete removes the entity and all the corresponding "roleTypeRole" entities in a transaction by the provided stringID of a key and returns an error.

Types

type RoleType

type RoleType struct {
	ID      string    `datastore:"-"`
	Created time.Time `json:"-"`
}

RoleType is a type of user's role like "inHouse" and "customer" for now. Key's stringID is type's itself.

func Put

func Put(ctx context.Context, rt *RoleType) (*RoleType, error)

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

type RoleTypes

type RoleTypes map[string]*RoleType

RoleTypes is a map of *RoleType with it's ID as key.

func GetMulti

func GetMulti(ctx context.Context, kx interface{}) (RoleTypes, 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, rt *RoleType) (RoleTypes, 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