pio

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

README

PredictionIO-sdk-go

Golang SDK for Apache PredictionIO

Documentation

Index

Constants

View Source
const (
	EventTypeSet    = "$set"
	EventTypeUnset  = "$unset"
	EventTypeDelete = "$delete"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EngineClient

type EngineClient struct {
	HOST      string
	AccessKey string
}

func NewEngineClient

func NewEngineClient(HOST string) *EngineClient

func (*EngineClient) Query

func (client *EngineClient) Query(query interface{}) ([]byte, error)

type Event

type Event struct {
	Event            string                 `json:"event"`
	EntityType       string                 `json:"entityType"`
	EntityID         string                 `json:"entityId"`
	TargetEntityType string                 `json:"targetEntityType,omitempty"`
	TargetEntityID   string                 `json:"targetEntityId,omitempty"`
	Properties       map[string]interface{} `json:"properties,omitempty"`
	EventTime        time.Time              `json:"eventTime"`
}

func NewEvent

func NewEvent(name string) *Event

func (*Event) SetEntityID

func (e *Event) SetEntityID(entityID string) *Event

func (*Event) SetEntityType

func (e *Event) SetEntityType(entityType string) *Event

func (*Event) SetEvent

func (e *Event) SetEvent(name string) *Event

func (*Event) SetEventTime

func (e *Event) SetEventTime(eventTime time.Time) *Event

func (*Event) SetProperties

func (e *Event) SetProperties(properties map[string]interface{}) *Event

func (*Event) SetTargetEntityID

func (e *Event) SetTargetEntityID(targetEntityID string) *Event

func (*Event) SetTargetEntityType

func (e *Event) SetTargetEntityType(targetEntityType string) *Event

type EventClient

type EventClient struct {
	HOST      string
	AccessKey string
}

func NewEventClient

func NewEventClient(HOST string, accessKey string) *EventClient

func (*EventClient) SentClient

func (client *EventClient) SentClient(event *Event) (*EventResponder, error)

type EventResponder

type EventResponder struct {
	EventID string `json:"eventId"`
}

Jump to

Keyboard shortcuts

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