Documentation ¶
Index ¶
- func BindAppWithInputs(app *App) error
- func Connect2Database() error
- func Connect2SplunkServer() (*splunk.SplunkConnection, error)
- func CreateDeploymentApp(deploymentApp DeploymentApp) error
- func CreateDeploymentServerClass(dplySCs []DeploymentServerClass) error
- func CreateTag(user, env string, dplySCs []DeploymentServerClass) error
- func DeinstallDeploymentApp(deploymentApp DeploymentApp) error
- func DeleteAnnouncement(id string) error
- func DeleteApp(appID int) error
- func DeleteDeployment(name, user string) error
- func DeleteDeploymentByAppID(appID int) error
- func DeleteDeploymentByIDs(appID int, scIDs []int) error
- func DeleteExpiredSession()
- func DeleteForwarder(name, user string) error
- func DeleteInput(inputID int, inputType string) error
- func DeleteServerClass(name, user string) error
- func DeleteServerClassByForwarderID(forwarderID int) error
- func DeleteSplunkHost(name string) error
- func DeleteSplunkUser(splunkUserName string) error
- func DeleteUnitPrice(id int) error
- func DeleteUser(userName string) error
- func GetAppName(appID int) (string, error)
- func GetInput(inputID int, inputType string) (interface{}, error)
- func GetInputs(envUser []string, inputType string, isAdmin bool) (interface{}, error)
- func GetInputsByAppID(envUser []string, appID int, inputType string, isAdmin bool) (interface{}, error)
- func GetServerClassIDsByAppID(appID int, getForwarders bool) ([]int, error)
- func GetSessionStore() (*mysqlstore.MySQLStore, error)
- func GetSplunkEndpoint(name, param string) string
- func GetSplunkHttpResponse(values url.Values, method, host, resource, param string) (*http.Response, error)
- func IsAdmin(userName string) bool
- func Migrate(conffile string) error
- func ParseHttpResponse(resp *http.Response, lineKeyWord, msg string) error
- func ParseTemplate(templateFileName string, data interface{}) (string, error)
- func PrepareSessionStore(conf settings.Configuration) error
- func RemoveDeploymentApp(deploymentApp DeploymentApp) error
- func RemoveDeploymentServerClass(dplySCs []DeploymentServerClass) error
- func ResetUserPassword(user User) error
- func SaveAnnouncement(announcement Announcement) error
- func SaveApp(app App) error
- func SaveDeployment(deploymentList []Deployment) error
- func SaveFileInput(input FileInput, envUser []string) error
- func SaveForwarder(forwarders []Forwarder) error
- func SaveScriptInput(input ScriptInput, envUser []string) error
- func SaveServerClass(sc ServerClass) error
- func SaveSplunkHost(splunkHost SplunkHost) error
- func SaveSplunkUser(splunkUser SplunkUser) error
- func SaveUnitPrice(unitPrice UnitPrice) error
- func SaveUnixAppInput(inputs []UnixAppInput, envUser []string) error
- func SaveUser(user User, sendEmail bool) error
- func SendEmail(from, to, target, who, function, subject, link string, ...) error
- func SpkChangeTagPermission(tagName, host string, forwarderWildcards []string) []string
- func SpkCheckServerClassExistence(env, sc string) error
- func SpkCreateDeploymentServerClass(sc DeploymentServerClass, host string) error
- func SpkCreateOrUpdateSplunkSamlGroup(userName, host, positionIDs string) error
- func SpkCreateSplunkApp(userName string, hosts []string) error
- func SpkCreateSplunkRole(userName string, hosts []string) error
- func SpkCreateSplunkUser(userName, password, email, positionID string, hosts []string) error
- func SpkCreateTag(tagName, host string, forwarderWildcards []string) error
- func SpkDeinstallDeploymentApp(appName, host string) error
- func SpkDeleteDeploymentServerClass(sc DeploymentServerClass, host string) error
- func SpkUpdateDeploymentServerClass(sc DeploymentServerClass, host string) error
- func SpkUpdateDistributedApp(scName, appName, host string) error
- func SpkVerifyTagPermission(tagName, host string, forwarderWildcards []string) []string
- func UpdateAnnouncement(id string, newAnnouncement Announcement) error
- func UpdateApp(appID int, newApp App) error
- func UpdateAppFieldsByID(appID int, fields []string, values []interface{}, tableName string) error
- func UpdateDeployment(user string, newDplyList []Deployment) error
- func UpdateFileInput(inputID int, newInput FileInput) error
- func UpdateForwarder(name, user string, newForwarder Forwarder) error
- func UpdateInputFields(inputIDs []int, fields []string, values []interface{}, tableName string) error
- func UpdateInputsFieldsByAppID(appID int, fields []string, values []interface{}, tableName string) error
- func UpdateScriptInput(inputID int, newInput ScriptInput) error
- func UpdateServerClass(name, user string, newServerClass ServerClass) error
- func UpdateSplunkHost(name string, newSplunkHost SplunkHost) error
- func UpdateSplunkUser(splunkUserName string, newSplunkUser SplunkUser) error
- func UpdateUnitPrice(id int, newUnitPrice UnitPrice) error
- func UpdateUnixAppInput(inputID int, newInput UnixAppInput) error
- func UpdateUser(userName string, newUser User, action string) error
- func VerifyCredentials(userName, password string) error
- type Announcement
- type App
- type Deployment
- type DeploymentApp
- type DeploymentInfo
- type DeploymentServerClass
- type FileInput
- type Forwarder
- type ID
- type IDStruct
- type LogSize
- type NameStruct
- type SamlGroup
- type ScriptInput
- type ServerClass
- type ServerClassForwarder
- type SplunkHost
- type SplunkUser
- type StorageSize
- type Tag
- type TemplateData
- type UnitPrice
- type UnixAppInput
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindAppWithInputs ¶
func Connect2Database ¶
func Connect2Database() error
func Connect2SplunkServer ¶
func Connect2SplunkServer() (*splunk.SplunkConnection, error)
func CreateDeploymentApp ¶
func CreateDeploymentApp(deploymentApp DeploymentApp) error
func CreateDeploymentServerClass ¶
func CreateDeploymentServerClass(dplySCs []DeploymentServerClass) error
func CreateTag ¶
func CreateTag(user, env string, dplySCs []DeploymentServerClass) error
func DeinstallDeploymentApp ¶
func DeinstallDeploymentApp(deploymentApp DeploymentApp) error
func DeleteAnnouncement ¶
func DeleteDeployment ¶
func DeleteDeploymentByAppID ¶
func DeleteDeploymentByIDs ¶
func DeleteExpiredSession ¶
func DeleteExpiredSession()
func DeleteForwarder ¶
func DeleteInput ¶
func DeleteServerClass ¶
func DeleteSplunkHost ¶
func DeleteSplunkUser ¶
func DeleteUnitPrice ¶
func DeleteUser ¶
func GetAppName ¶
func GetInputsByAppID ¶
func GetSessionStore ¶
func GetSessionStore() (*mysqlstore.MySQLStore, error)
func GetSplunkEndpoint ¶
func GetSplunkHttpResponse ¶
func ParseTemplate ¶
func PrepareSessionStore ¶
func PrepareSessionStore(conf settings.Configuration) error
func RemoveDeploymentApp ¶
func RemoveDeploymentApp(deploymentApp DeploymentApp) error
func RemoveDeploymentServerClass ¶
func RemoveDeploymentServerClass(dplySCs []DeploymentServerClass) error
func ResetUserPassword ¶
func SaveAnnouncement ¶
func SaveAnnouncement(announcement Announcement) error
func SaveDeployment ¶
func SaveDeployment(deploymentList []Deployment) error
func SaveFileInput ¶
func SaveForwarder ¶
func SaveScriptInput ¶
func SaveScriptInput(input ScriptInput, envUser []string) error
func SaveServerClass ¶
func SaveServerClass(sc ServerClass) error
func SaveSplunkHost ¶
func SaveSplunkHost(splunkHost SplunkHost) error
func SaveSplunkUser ¶
func SaveSplunkUser(splunkUser SplunkUser) error
func SaveUnitPrice ¶
func SaveUnixAppInput ¶
func SaveUnixAppInput(inputs []UnixAppInput, envUser []string) error
func SpkChangeTagPermission ¶
func SpkCreateDeploymentServerClass ¶
func SpkCreateDeploymentServerClass(sc DeploymentServerClass, host string) error
func SpkCreateSplunkApp ¶
func SpkCreateSplunkRole ¶
func SpkCreateSplunkUser ¶
func SpkCreateTag ¶
func SpkDeleteDeploymentServerClass ¶
func SpkDeleteDeploymentServerClass(sc DeploymentServerClass, host string) error
func SpkUpdateDeploymentServerClass ¶
func SpkUpdateDeploymentServerClass(sc DeploymentServerClass, host string) error
func SpkUpdateDistributedApp ¶
func SpkVerifyTagPermission ¶
func UpdateAnnouncement ¶
func UpdateAnnouncement(id string, newAnnouncement Announcement) error
func UpdateAppFieldsByID ¶
func UpdateDeployment ¶
func UpdateDeployment(user string, newDplyList []Deployment) error
func UpdateFileInput ¶
func UpdateForwarder ¶
func UpdateInputFields ¶
func UpdateScriptInput ¶
func UpdateScriptInput(inputID int, newInput ScriptInput) error
func UpdateServerClass ¶
func UpdateServerClass(name, user string, newServerClass ServerClass) error
func UpdateSplunkHost ¶
func UpdateSplunkHost(name string, newSplunkHost SplunkHost) error
func UpdateSplunkUser ¶
func UpdateSplunkUser(splunkUserName string, newSplunkUser SplunkUser) error
func UpdateUnitPrice ¶
func UpdateUnixAppInput ¶
func UpdateUnixAppInput(inputID int, newInput UnixAppInput) error
func VerifyCredentials ¶
Types ¶
type Announcement ¶
type Announcement struct { ID int `json:"id"` Content string `json:"content" gorm:"size:1000"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
func GetAnnouncement ¶
func GetAnnouncement(id string) (Announcement, error)
func GetAnnouncements ¶
func GetAnnouncements() ([]Announcement, error)
type App ¶
type App struct { ID int `json:"id"` Name string `json:"name"` Env string `json:"env"` UserName string `json:"user_name"` //added later DeployStatus int `json:"deploy_status"` // UserID int `json:"user_id"` //to remove // SplunkHostID int `json:"splunk_host_id"` //to remove UnixApp bool `json:"unix_app"` FileInputIDs []IDStruct `json:"file_input_ids" gorm:"-"` //add, update ScriptInputIDs []IDStruct `json:"script_input_ids" gorm:"-"` //add, update UnixAppInputIDs []IDStruct `json:"unix_app_input_ids" gorm:"-"` //add, update ServerClass []ServerClass `json:"server_classes" gorm:"-"` //for display in deployment ServerClassIDs []IDStruct `json:"server_class_ids" gorm:"-"` //for update in deployment FileInputs []FileInput `json:"file_inputs" gorm:"-"` //display ScriptInputs []ScriptInput `json:"script_inputs" gorm:"-"` //display UnixAppInputs []UnixAppInput `json:"unix_app_inputs" gorm:"-"` //display CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type Deployment ¶
type Deployment struct { ID int `json:"id"` AppID int `json:"app_id"` ServerClassID int `json:"server_class_id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
func GetDeployment ¶
func GetDeployment(name, user string) (Deployment, error)
func GetDeploymentList ¶
func GetDeploymentList(envUserFrom []string) ([]Deployment, error)
type DeploymentApp ¶
type DeploymentInfo ¶
type DeploymentServerClass ¶
type DeploymentServerClass struct { ServerClassName string `json:"server_class_name" gorm:"-"` AppName string `json:"app_name" gorm:"-"` AppID int `json:"app_id" gorm:"-"` ForwarderNames []NameStruct `json:"forwarder_names" gorm:"-"` User string `json:"user" gorm:"-"` Env string `json:"env" gorm:"-"` }
type FileInput ¶
type FileInput struct { ID int `json:"id"` LogFilePath string `json:"log_file_path"` Sourcetype string `json:"sourcetype"` LogFileSize string `json:"log_file_size"` DataRetentionPeriod string `json:"data_retention_period"` Memo string `json:"memo"` // Status int `json:"status"` // to remove Env string `json:"env"` //added later UserName string `json:"user_name"` //added later // SplunkUserID int `json:"splunk_user_id"` // to remove AppID int `json:"app_id"` AppName string `json:"app_name" gorm:"-"` //for display Blacklist string `json:"blacklist"` Crcsalt string `json:"crcsalt"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type Forwarder ¶
type Forwarder struct { ID int `json:"id"` Name string `json:"name"` UserName string `json:"user_name"` Env string `json:"env"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
func GetForwarder ¶
func GetForwardersByIDs ¶
func SpkGetForwarders ¶
type LogSize ¶
type LogSize struct { ServiceID string `json:"service_id"` Host string `json:"host"` SizeMB int `json:"size_mb"` }
func GetLogSize ¶
type NameStruct ¶
type NameStruct struct {
Name string `json:"name"`
}
type SamlGroup ¶
func SpkGetSamlRoles ¶
type ScriptInput ¶
type ScriptInput struct { ID int `json:"id"` Sourcetype string `json:"sourcetype"` LogFileSize string `json:"log_file_size"` DataRetentionPeriod string `json:"data_retention_period"` Env string `json:"env"` //added later // Memo string `json:"memo"` // Status int `json:"status"` // to remove UserName string `json:"user_name"` //added later // SplunkUserID int `json:"splunk_user_id"` // to remove AppID int `json:"app_id"` AppName string `json:"app_name" gorm:"-"` //for display OS string `json:"os"` Interval string `json:"interval"` ScriptName string `json:"script_name"` Script []byte `json:"script" gorm:"size:10240"` ScriptCode string `json:"script_code" gorm:"-"` Option string `json:"option"` Exefile bool `json:"exefile"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type ServerClass ¶
type ServerClass struct { ID int `json:"id"` Name string `json:"name"` UserName string `json:"user_name"` Env string `json:"env"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` ForwarderIDs []int `json:"forwarder_ids" gorm:"-"` // for add, update, delete Forwarders []string `json:"forwarders" gorm:"-"` // for display }
func GetServerClass ¶
func GetServerClass(name, user string) (ServerClass, error)
func GetServerClasses ¶
func GetServerClasses(envUser []string, isAdmin bool) ([]ServerClass, error)
func GetServerClassesByIDs ¶
func GetServerClassesByIDs(scIDs []int, getForwarders bool) ([]ServerClass, error)
type ServerClassForwarder ¶
type SplunkHost ¶
type SplunkHost struct { ID int `json:"id"` Name string `json:"name" sql:"unique_index"` Role string `json:"role"` Env string `json:"env"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
func GetSplunkHost ¶
func GetSplunkHost(name string) (SplunkHost, error)
func GetSplunkHostByEnvRole ¶
func GetSplunkHostByEnvRole(envAndRole []string) (SplunkHost, error)
func GetSplunkHosts ¶
func GetSplunkHosts(envAndRole []string) ([]SplunkHost, error)
type SplunkUser ¶
type SplunkUser struct { ID int `json:"id"` UserName string `json:"user_name"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` RpaasUserName string `json:"rpaas_user_name"` Env string `json:"env"` Memo string `json:"memo"` SearchHead string `json:"search_head"` Email string `json:"email"` PositionIDs string `json:"position_ids"` Password string `gorm:"-"` }
func GetSplunkUser ¶
func GetSplunkUser(splunkUserName string, env string) (SplunkUser, error)
func GetSplunkUsers ¶
func GetSplunkUsers() ([]SplunkUser, error)
type StorageSize ¶
type StorageSize struct { ServiceID string `json:"service_id"` IndexName string `json:"index_name"` SizeMB int `json:"size_mb"` }
func GetStorageSize ¶
func GetStorageSize(month, serviceID string) ([]StorageSize, error)
type Tag ¶
type Tag struct { Name string `json:"name"` Hosts []string `json:"hosts"` SourceTypes []string `json:"source_types"` Sources []string `json:"sources"` GUIDs []string `json:"guids"` }
func SpkGetTagFields ¶
type TemplateData ¶
type UnitPrice ¶
type UnitPrice struct { ID int `json:"id"` ServicePrice int `json:"service_price"` StoragePrice int `json:"storage_price"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
func GetUnitPrice ¶
func GetUnitPrices ¶
type UnixAppInput ¶
type UnixAppInput struct { ID int `json:"id"` // Sourcetype string `json:"sourcetype"` DataRetentionPeriod string `json:"data_retention_period"` // Status int `json:"status"` // to remove Env string `json:"env"` // added later UserName string `json:"user_name"` //added later // SplunkUserID int `json:"splunk_user_id"` //to remove AppID int `json:"app_id"` AppName string `json:"app_name" gorm:"-"` //for display Interval string `json:"interval"` ScriptName string `json:"script_name"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type User ¶
type User struct { ID int `json:"id"` Admin bool `json:"admin"` UserName string `json:"user_name" sql:"unique_index"` Email string `json:"email"` EmailForEmergency string `json:"email_for_emergency"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` LastLoginAt time.Time `json:"last_login_at"` Password string `json:"password"` GroupName string `json:"group_name"` AppTeamName string `json:"app_team_name"` // ServiceID int `json:"service_id"` ServiceID string `json:"service_id"` Status string `json:"status"` }
Click to show internal directories.
Click to hide internal directories.