feast: github.com/gojek/feast/sdk/go Index | Files | Directories

package feast

import "github.com/gojek/feast/sdk/go"

Index

Package Files

client.go request.go response.go types.go

Variables

var (
    // ErrLengthMismatch indicates that the number of values returned is not the same as the number of values requested
    ErrLengthMismatch = "Length mismatch; number of na values (%d) not equal to number of features requested (%d)."

    // ErrFeatureNotFound indicates that the a requested feature was not found in the response
    ErrFeatureNotFound = "Feature %s not found in response."

    // ErrTypeMismatch indicates that the there was a type mismatch in the returned values
    ErrTypeMismatch = "Requested output of type %s does not match type of feature value returned."
)
var (
    // ErrInvalidFeatureRef indicates that the user has provided a feature reference
    // with the wrong structure or contents
    ErrInvalidFeatureRef = "Invalid Feature Reference %s provided, " +
        "feature reference must be in the format [featureset:]name"
)

func BoolVal Uses

func BoolVal(val bool) *types.Value

BoolVal is a bool type feast value

func BytesVal Uses

func BytesVal(val []byte) *types.Value

BytesVal is a bytes type feast value

func DoubleVal Uses

func DoubleVal(val float64) *types.Value

DoubleVal is a float64 type feast value

func FloatVal Uses

func FloatVal(val float32) *types.Value

FloatVal is a float32 type feast value

func Int32Val Uses

func Int32Val(val int32) *types.Value

Int32Val is a int64 type feast value

func Int64Val Uses

func Int64Val(val int64) *types.Value

Int64Val is a int64 type feast value

func StrVal Uses

func StrVal(val string) *types.Value

StrVal is a int64 type feast value

type Client Uses

type Client interface {
    GetOnlineFeatures(ctx context.Context, req *OnlineFeaturesRequest) (*OnlineFeaturesResponse, error)
    GetFeastServingInfo(ctx context.Context, in *serving.GetFeastServingInfoRequest) (*serving.GetFeastServingInfoResponse, error)
    Close() error
}

Client is a feast serving client.

type GrpcClient Uses

type GrpcClient struct {
    // contains filtered or unexported fields
}

GrpcClient is a grpc client for feast serving.

func NewGrpcClient Uses

func NewGrpcClient(host string, port int) (*GrpcClient, error)

NewGrpcClient constructs a client that can interact via grpc with the feast serving instance at the given host:port.

func (*GrpcClient) Close Uses

func (fc *GrpcClient) Close() error

Close the grpc connection.

func (*GrpcClient) GetFeastServingInfo Uses

func (fc *GrpcClient) GetFeastServingInfo(ctx context.Context, in *serving.GetFeastServingInfoRequest) (
    *serving.GetFeastServingInfoResponse, error)

GetFeastServingInfo gets information about the feast serving instance this client is connected to.

func (*GrpcClient) GetOnlineFeatures Uses

func (fc *GrpcClient) GetOnlineFeatures(ctx context.Context, req *OnlineFeaturesRequest) (
    *OnlineFeaturesResponse, error)

GetOnlineFeatures gets the latest values of the request features from the Feast serving instance provided.

type OnlineFeaturesRequest Uses

type OnlineFeaturesRequest struct {
    // Features is the list of features to obtain from Feast. Each feature can be given as
    // the format feature_set:feature, where "feature_set" & "feature" are feature set name
    // and feature name respectively. The only required components is feature name.
    Features []string

    // Entities is the list of entity rows to retrieve features on. Each row is a map of entity name to entity value.
    Entities []Row

    // Project specifies the project would contain the feature sets where the requested features belong to.
    Project string
}

OnlineFeaturesRequest wrapper on feast.serving.GetOnlineFeaturesRequest.

type OnlineFeaturesResponse Uses

type OnlineFeaturesResponse struct {
    RawResponse *serving.GetOnlineFeaturesResponse
}

OnlineFeaturesResponse is a wrapper around serving.GetOnlineFeaturesResponse.

func (OnlineFeaturesResponse) Float64Arrays Uses

func (r OnlineFeaturesResponse) Float64Arrays(order []string, fillNa []float64) ([][]float64, error)

Float64Arrays retrieves the result of the request as a list of float64 slices. Any missing values will be filled with the missing values provided.

func (OnlineFeaturesResponse) Int64Arrays Uses

func (r OnlineFeaturesResponse) Int64Arrays(order []string, fillNa []int64) ([][]int64, error)

Int64Arrays retrieves the result of the request as a list of int64 slices. Any missing values will be filled with the missing values provided.

func (OnlineFeaturesResponse) Rows Uses

func (r OnlineFeaturesResponse) Rows() []Row

Rows retrieves the result of the request as a list of Rows.

type Row Uses

type Row map[string]*types.Value

Row map of entity values

Directories

PathSynopsis
protos/feast/serving
protos/feast/storage
protos/feast/types

Package feast imports 9 packages (graph). Updated 2020-05-25. Refresh now. Tools for package owners.