コード例 #1
0
ファイル: main.go プロジェクト: whitbyschool/radigast-plugins
func (a VeracrossAPI) Register() []victor.HandlerDocPair {
	var handler victor.HandlerFunc
	if len(a.AllowedUsers) == 0 {
		handler = a.rotationFunc
	} else {
		handler = victor.OnlyAllow(a.AllowedUsers, a.rotationFunc)
	}
	return []victor.HandlerDocPair{
		&victor.HandlerDoc{
			CmdHandler:     handler,
			CmdName:        "rotation",
			CmdDescription: "Upper School Rotation",
			CmdUsage:       []string{"2015-09-30"},
		},
	}
}
コード例 #2
0
ファイル: autopkg.go プロジェクト: robmurtha/radigast
func (a Autopkg) Register() []victor.HandlerDocPair {
	// Allow everyone or just a specific group of users?
	var handler victor.HandlerFunc
	if len(a.AllowedUsers) == 0 {
		handler = a.autopkgFunc
	} else {
		handler = victor.OnlyAllow(a.AllowedUsers, a.autopkgFunc)
	}

	return []victor.HandlerDocPair{
		&victor.HandlerDoc{
			CmdHandler:     handler,
			CmdName:        "autopkg",
			CmdDescription: "check for new versions of software and add to munki",
			CmdUsage:       []string{""},
		},
	}
}
コード例 #3
0
func (a Veracross) Register() []victor.HandlerDocPair {
	// Allow everyone or just a specific group of users?
	var handler victor.HandlerFunc
	if len(a.AllowedUsers) == 0 {
		handler = a.scheduleFunc
	} else {
		handler = victor.OnlyAllow(a.AllowedUsers, a.scheduleFunc)
	}

	return []victor.HandlerDocPair{
		&victor.HandlerDoc{
			CmdHandler:     handler,
			CmdName:        "schedule",
			CmdDescription: "Student and Faculty Schedules",
			CmdUsage:       []string{"First Last"},
		},
	}
}