Documentation ¶
Overview ¶
Copyright © 2020 NAME HERE <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2020 NAME HERE <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func DumpDepartments(id int) (Department, []Department)
- func DumpEmployee(id int, ch chan Employee, titles []Title, salaries []Salary, ...)
- func Execute()
- func GetManagerTitle(deptManagers []Department, from time.Time, to time.Time) bool
- func InitIds() ([]int, error)
- func InsertMany(chunk []Employee, ch chan int)
- func MakeChunks(employees []Employee) [][]Employee
- func ToJson(emps []Employee)
- type Department
- type Employee
- type Salary
- type Title
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DumpDepartments ¶
func DumpDepartments(id int) (Department, []Department)
func DumpEmployee ¶
func DumpEmployee(id int, ch chan Employee, titles []Title, salaries []Salary, current Department, history []Department)
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func GetManagerTitle ¶
func InsertMany ¶
func MakeChunks ¶
Types ¶
type Department ¶
type Department struct { Number string `json:"dept_no" bson:"dept_no"` Name string `json:"dept_name" bson:"dept_name"` From time.Time `json:"from_date" bson:"from_date"` To time.Time `json:"to_date,omitempty" bson:"to_date,omitempty"` }
func DumpDeptManager ¶
func DumpDeptManager(id int) []Department
type Employee ¶
type Employee struct { EmpNo int `json:"emp_no" bson:"emp_no"` BirthDate time.Time `json:"birth_date" bson:"birth_date"` FirstName string `json:"first_name" bson:"first_name"` LastName string `json:"last_name" bson:"last_name"` Gender string `json:"gender" bson:"gender"` HireDate time.Time `json:"hire_date" bson:"hire_date"` Titles []Title `json:"titles" bson:"titles"` Salaries []Salary `json:"salaries" bson:"salaries"` DeptCurrent Department `json:"current_dept" bson:"current_dept"` DeptHistory []Department `json:"dept_history,omitempty" bson:"dept_history"` }