machineLearning

package
v0.0.0-...-fb315dc Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2019 License: MIT Imports: 9 Imported by: 0

README

#HAL Machine Learning Service

We want to be able to store all the requests HAL recieves from automated systems, such as app dynamics, sensu, ect.. Then, we want to log the actions taken by the requests.

Using the data, especially where HAL could not take any action, we want to be able to start using the data to be able to teach HAL what to do based on a request.

Documentation

Overview

Package machineLearning is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockStore

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

MockStore is a mock of Store interface

func NewMockStore

func NewMockStore(ctrl *gomock.Controller) *MockStore

NewMockStore creates a new mock instance

func (*MockStore) EXPECT

func (m *MockStore) EXPECT() *MockStoreMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockStore) SaveAction

func (m *MockStore) SaveAction(requestID, action string, date time.Time, fields map[string]interface{})

SaveAction mocks base method

func (*MockStore) SaveInputRecord

func (m *MockStore) SaveInputRecord(reqType string, date time.Time, fields map[string]interface{}) string

SaveInputRecord mocks base method

type MockStoreMockRecorder

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

MockStoreMockRecorder is the mock recorder for MockStore

func (*MockStoreMockRecorder) SaveAction

func (mr *MockStoreMockRecorder) SaveAction(requestID, action, date, fields interface{}) *gomock.Call

SaveAction indicates an expected call of SaveAction

func (*MockStoreMockRecorder) SaveInputRecord

func (mr *MockStoreMockRecorder) SaveInputRecord(reqType, date, fields interface{}) *gomock.Call

SaveInputRecord indicates an expected call of SaveInputRecord

type Service

type Service interface {
	StoreHTTPRequest(ctx context.Context, request *http.Request) context.Context
	StoreAction(ctx context.Context, action string, fields map[string]interface{})
}

Service forms the basis to build a machine learning data set.

The idea is to log all automated requests into the system and correlate them with actions taken by HAL. Doing so, we will have a link between request and response for audit purposes, however the plan is to use the data to try and implement some machine learning, where we can teach HAL what actions to take based on input.

func NewService

func NewService(store Store) Service

NewService returns a new Machine Learning Service.

type Store

type Store interface {
	SaveInputRecord(reqType string, date time.Time, fields map[string]interface{}) string
	SaveAction(requestID string, action string, date time.Time, fields map[string]interface{})
}

Store will save the Machine Learning information to a database

func NewMongoStore

func NewMongoStore(db *mgo.Database) Store

NewMongoStore will return a mongo store service to be able to store Machine Learning information to a Mongo Database

Jump to

Keyboard shortcuts

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