frontend

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ActionKind = "ActionKind"

ActionKind is the kind of an action

View Source
const ObservationKind = "ObservationKind"

ObservationKind is the kind of an observation.

Variables

This section is empty.

Functions

func InstallServices

func InstallServices(srv *prpc.Server)

InstallServices takes a Karte frontend and exposes it to a LUCI prpc.Server.

func NewKarteFrontend

func NewKarteFrontend() kartepb.KarteServer

NewKarteFrontend produces a new Karte frontend.

func PutActionEntities

func PutActionEntities(ctx context.Context, entities ...*ActionEntity) error

PutActionEntities writes action entities to datastore.

func PutObservationEntities

func PutObservationEntities(ctx context.Context, entities ...*ObservationEntity) error

PutObservationEntities writes multiple observation entites to datastore.

Types

type ActionEntitiesQuery

type ActionEntitiesQuery struct {
	// Token is the pagination token used by datastore.
	Token string
	// Query is a wrapped datastore query.
	Query *datastore.Query
}

ActionEntitiesQuery is a wrapped query of action entities bearing a page token.

func MakeAllActionEntitiesQuery

func MakeAllActionEntitiesQuery(token string) *ActionEntitiesQuery

MakeAllActionEntitiesQuery makes an action entities query that starts at the position implied by the given token and lists all action entities.

func (*ActionEntitiesQuery) Next

func (q *ActionEntitiesQuery) Next(ctx context.Context, batchSize int32) ([]*ActionEntity, error)

Next takes a batch size and returns the next batch of action entities from a query.

type ActionEntity

type ActionEntity struct {
	ID string `gae:"$id"`
	// contains filtered or unexported fields
}

ActionEntity is the datastore entitiy for actions.

func ConvertActionToActionEntity

func ConvertActionToActionEntity(action *kartepb.Action) (*ActionEntity, error)

ConvertActionToActionEntity takes an action and converts it to an action entity.

func (*ActionEntity) ConvertToAction

func (e *ActionEntity) ConvertToAction() *kartepb.Action

ConvertToAction converts a datastore action entity to an action proto.

type ObservationEntitiesQuery

type ObservationEntitiesQuery struct {
	// Token is the pagination token used by datastore.
	Token string
	// Query is a wrapped datastore query.
	Query *datastore.Query
}

ObservationEntitiesQuery is a wrapped query of action entities bearing a page token.

func MakeAllObservationEntitiesQuery

func MakeAllObservationEntitiesQuery(token string) *ObservationEntitiesQuery

MakeAllObservationEntitiesQuery makes an action entities query that starts at the position implied by the page token and lists all action entities.

func (*ObservationEntitiesQuery) Next

func (q *ObservationEntitiesQuery) Next(ctx context.Context, batchSize int32) ([]*ObservationEntity, error)

Next takes a batch size and returns the next batch of observation entities from a query.

type ObservationEntity

type ObservationEntity struct {
	ID string `gae:"$id"`
	// contains filtered or unexported fields
}

ObservationEntity is the datastore entity for observations.

func (*ObservationEntity) ConvertToObservation

func (e *ObservationEntity) ConvertToObservation() *kartepb.Observation

ConvertToObservation converts a datastore observation entity to an observation proto.

Jump to

Keyboard shortcuts

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