user

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: 16 Imported by: 0

README

HAL User Management

Bulk Upload

Make a POST request to /users/ with a semi colon delimited file for your users

;;

Jira ID can be left blank.

Documentation

Overview

Package user 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

MakeHandler returns a HTTP Restul endpoint to handle user requests

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

func (m *MockStore) AddUpdateUser(employeeNumber, CalloutName, JiraName string)

AddUpdateUser 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) FindUserByCalloutName

func (m *MockStore) FindUserByCalloutName(name string) User

FindUserByCalloutName mocks base method

type MockStoreMockRecorder

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

MockStoreMockRecorder is the mock recorder for MockStore

func (*MockStoreMockRecorder) AddUpdateUser

func (mr *MockStoreMockRecorder) AddUpdateUser(employeeNumber, CalloutName, JiraName interface{}) *gomock.Call

AddUpdateUser indicates an expected call of AddUpdateUser

func (*MockStoreMockRecorder) FindUserByCalloutName

func (mr *MockStoreMockRecorder) FindUserByCalloutName(name interface{}) *gomock.Call

FindUserByCalloutName indicates an expected call of FindUserByCalloutName

type Service

type Service interface {
	// contains filtered or unexported methods
}

Service interface to mamage users on HAL

func NewInstrumentService

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

NewInstrumentService creates a prometheus service that will log request count, error count and latency

func NewLoggingService

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

NewLoggingService creates a loggng service to log the request and response from the service

func NewService

func NewService(store Store) Service

NewService returns a new User Service

type Store

type Store interface {
	/*
		AddUpdateUser will verify if the employee number already exists in the DB. If it does, its updated, else added
	*/
	AddUpdateUser(employeeNumber, CalloutName, JiraName string)

	/*
		FindUserByCalloutName Return a user whos details matches the callout
	*/
	FindUserByCalloutName(name string) User
}

func NewMongoStore

func NewMongoStore(db *mgo.Database) Store

type User

type User struct {
	ID             bson.ObjectId `bson:"_id,omitempty"`
	EmployeeNumber string        `json:"employeeNumber"`
	CallOutName    string        `json:"calloutName"`
	JIRAName       string        `json:"jiraName"`
}

User Json object

Jump to

Keyboard shortcuts

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