chef

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

Documentation

Overview

Package mock_chef is a generated GoMock package.

Package chef is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeHandler

func MakeHandler(service Service, logger kitlog.Logger, ml machineLearning.Service) http.Handler

Types

type AddChefClientRequest

type AddChefClientRequest struct {
	Name, Key, URL string
}

type ChefEnvironment

type ChefEnvironment struct {
	ID           bson.ObjectId `bson:"_id,omitempty"`
	Environment  string
	FriendlyName string
	ChatID       uint32
}

ChefEnvironment contains the chef environments this bot is allowed to use in CHEF

type MockService

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

MockService is a mock of Service interface

func NewMockService

func NewMockService(ctrl *gomock.Controller) *MockService

NewMockService creates a new mock instance

func (*MockService) EXPECT

func (m *MockService) EXPECT() *MockServiceMockRecorder

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

func (*MockService) FindNodesFromFriendlyNames

func (m *MockService) FindNodesFromFriendlyNames(recipe, environment string, chat uint32) []Node

FindNodesFromFriendlyNames mocks base method

type MockServiceMockRecorder

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

MockServiceMockRecorder is the mock recorder for MockService

func (*MockServiceMockRecorder) FindNodesFromFriendlyNames

func (mr *MockServiceMockRecorder) FindNodesFromFriendlyNames(recipe, environment, chat interface{}) *gomock.Call

FindNodesFromFriendlyNames indicates an expected call of FindNodesFromFriendlyNames

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) AddChefEnvironment

func (m *MockStore) AddChefEnvironment(environment, friendlyName string, chatid uint32) error

AddChefEnvironment mocks base method

func (*MockStore) AddRecipe

func (m *MockStore) AddRecipe(recipeName, friendlyName string, chatid uint32) error

AddRecipe mocks base method

func (*MockStore) EXPECT

func (m *MockStore) EXPECT() *MockStoreMockRecorder

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

func (*MockStore) GetChefEnvironments

func (m *MockStore) GetChefEnvironments() ([]ChefEnvironment, error)

GetChefEnvironments mocks base method

func (*MockStore) GetEnvironmentForGroup

func (m *MockStore) GetEnvironmentForGroup(chat uint32) ([]ChefEnvironment, error)

GetEnvironmentForGroup mocks base method

func (*MockStore) GetEnvironmentFromFriendlyName

func (m *MockStore) GetEnvironmentFromFriendlyName(recipe string, chat uint32) (string, error)

GetEnvironmentFromFriendlyName mocks base method

func (*MockStore) GetRecipeFromFriendlyName

func (m *MockStore) GetRecipeFromFriendlyName(recipe string, chat uint32) (string, error)

GetRecipeFromFriendlyName mocks base method

func (*MockStore) GetRecipes

func (m *MockStore) GetRecipes() ([]Recipe, error)

GetRecipes mocks base method

func (*MockStore) GetRecipesForGroup

func (m *MockStore) GetRecipesForGroup(chat uint32) ([]Recipe, error)

GetRecipesForGroup mocks base method

type MockStoreMockRecorder

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

MockStoreMockRecorder is the mock recorder for MockStore

func (*MockStoreMockRecorder) AddChefEnvironment

func (mr *MockStoreMockRecorder) AddChefEnvironment(environment, friendlyName, chatid interface{}) *gomock.Call

AddChefEnvironment indicates an expected call of AddChefEnvironment

func (*MockStoreMockRecorder) AddRecipe

func (mr *MockStoreMockRecorder) AddRecipe(recipeName, friendlyName, chatid interface{}) *gomock.Call

AddRecipe indicates an expected call of AddRecipe

func (*MockStoreMockRecorder) GetChefEnvironments

func (mr *MockStoreMockRecorder) GetChefEnvironments() *gomock.Call

GetChefEnvironments indicates an expected call of GetChefEnvironments

func (*MockStoreMockRecorder) GetEnvironmentForGroup

func (mr *MockStoreMockRecorder) GetEnvironmentForGroup(chat interface{}) *gomock.Call

GetEnvironmentForGroup indicates an expected call of GetEnvironmentForGroup

func (*MockStoreMockRecorder) GetEnvironmentFromFriendlyName

func (mr *MockStoreMockRecorder) GetEnvironmentFromFriendlyName(recipe, chat interface{}) *gomock.Call

GetEnvironmentFromFriendlyName indicates an expected call of GetEnvironmentFromFriendlyName

func (*MockStoreMockRecorder) GetRecipeFromFriendlyName

func (mr *MockStoreMockRecorder) GetRecipeFromFriendlyName(recipe, chat interface{}) *gomock.Call

GetRecipeFromFriendlyName indicates an expected call of GetRecipeFromFriendlyName

func (*MockStoreMockRecorder) GetRecipes

func (mr *MockStoreMockRecorder) GetRecipes() *gomock.Call

GetRecipes indicates an expected call of GetRecipes

func (*MockStoreMockRecorder) GetRecipesForGroup

func (mr *MockStoreMockRecorder) GetRecipesForGroup(chat interface{}) *gomock.Call

GetRecipesForGroup indicates an expected call of GetRecipesForGroup

type Node

type Node struct {
	Name        string
	Environment string
}

type Recipe

type Recipe struct {
	ID           bson.ObjectId `bson:"_id,omitempty"`
	Recipe       string
	FriendlyName string
	ChatID       uint32
}

Recipe are the chef recipes the bot wants to interact with

type Service

type Service interface {
	FindNodesFromFriendlyNames(ctx context.Context, recipe, environment string, chat uint32) []Node
	// contains filtered or unexported methods
}

func NewInstrumentService

func NewInstrumentService(counter metrics.Counter, latency metrics.Histogram, s Service) Service

func NewLoggingService

func NewLoggingService(logger log.Logger, s Service) Service

func NewService

func NewService(alert alert.Service, chefStore Store) Service

type Store

type Store interface {

	/*
		AddChefEnvironment Adds a chef environment to alert on
	*/
	AddChefEnvironment(environment, friendlyName string, chatid uint32) error

	/*
		GetChefEnvironments will return all the chef environments in the database
	*/
	GetChefEnvironments() ([]ChefEnvironment, error)

	/*
		GetEnvironmentForGroup will return all chef environments for a group
	*/
	GetEnvironmentForGroup(chat uint32) ([]ChefEnvironment, error)

	/*
		GetEnvironmentFromFriendlyName returns the chef environment name based on the user friendly name supplied
	*/
	GetEnvironmentFromFriendlyName(recipe string, chat uint32) (string, error)

	/*
		GetRecipesForGroup will return all the recipes configured for a group
	*/
	GetRecipesForGroup(chat uint32) ([]Recipe, error)

	/*
		AddRecipe will add a recipe to the watch list for the bot
	*/
	AddRecipe(recipeName, friendlyName string, chatid uint32) error

	/*
		GetRecipes returns all the configured chef recipes. 0 length if none exists or there is an error.
	*/
	GetRecipes() ([]Recipe, error)

	GetRecipeFromFriendlyName(recipe string, chat uint32) (string, error)
}

func NewMongoStore

func NewMongoStore(mongo *mgo.Database) Store

Jump to

Keyboard shortcuts

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