Documentation
¶
Overview ¶
Copyright 2020 Alexey Yanchenko <mail@yanchenko.me>
This file is part of the Gufo library.
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 ¶
- Variables
- func AnsDef(i int)
- func AnsNo()
- func AskForConfigFile(i int)
- func CheckConfig()
- func CheckForFlags()
- func CheckForSign()
- func ConfigString(conf string) string
- func ConvertAnyToInterface(anyValue *anypb.Any) (interface{}, error)
- func ConvertInterfaceToAny(v interface{}) (*anypb.Any, error)
- func CreateConfig()
- func CreateGravatar(data []byte, length, blockLength int) image.Image
- func DBCheck() bool
- func DecryptConfigPasswords(pwd string) string
- func DerefString(s *string) string
- func EncryptConfigPassword(pwd string) (string, error)
- func ErrorReturn(t *pb.Request, httpcode int, code string, message string) (response *pb.Response)
- func GRPCConnect(host string, port string, t *pb.Request) (answer map[string]interface{})
- func GRPCDelete(misroservice string, param string, paramid string, args map[string]interface{}, ...) map[string]interface{}
- func GRPCGen(misroservice string, param string, paramid string, args map[string]interface{}, ...) map[string]interface{}
- func GRPCGet(misroservice string, param string, paramid string, args map[string]interface{}, ...) map[string]interface{}
- func GRPCPatch(misroservice string, param string, paramid string, args map[string]interface{}, ...) map[string]interface{}
- func GRPCPost(misroservice string, param string, paramid string, args map[string]interface{}, ...) map[string]interface{}
- func GRPCPut(misroservice string, param string, paramid string, args map[string]interface{}, ...) map[string]interface{}
- func GRPCReq(misroservice string, param string, paramid string, args map[string]interface{}, ...) map[string]interface{}
- func GRPCTrace(misroservice string, param string, paramid string, args map[string]interface{}, ...) map[string]interface{}
- func GenString(n int, alphanum string) string
- func GetLogDir() string
- func GetPass(conf string) string
- func HashConfigPasswords()
- func Hashgen(n int) string
- func InitCache()
- func Int32(v int) *int32
- func Interfacetoresponse(request *pb.Request, answer map[string]interface{}) (response *pb.Response)
- func JsonGet(url string, args map[string]interface{}, token string, tokentype string, ...) ([]byte, error)
- func JsonReq(url string, args map[string]interface{}, token string, tokentype string, ...) ([]byte, error)
- func Numgen(n int) string
- func Pad(src []byte) []byte
- func RandomString(l int) string
- func ReadUserIP(r *http.Request) string
- func SendHTMLEmail(to string, title string, link []string, subject string, templ string, ...)
- func SetErrorLog(value string)
- func SetLog(value string)
- func Stringen(n int) string
- func ToMapStringAny(v map[string]interface{}) map[string]*anypb.Any
- func ToMapStringInterface(v map[string]*anypb.Any) map[string]interface{}
- func Unpad(src []byte) ([]byte, error)
- func WriteLog(value string, p string)
- type DBv2
- type MailRequest
- type MailSettings
- type Response
Constants ¶
This section is empty.
Variables ¶
var AesKey = []byte("H4fnCsMf4vbE60nK")
AesKey is salt for pasword hash
var Configpath string = "/var/gufo/config/"
var DBConnectionv2 = &DBv2{}
Connection instance
Functions ¶
func AskForConfigFile ¶
func AskForConfigFile(i int)
func CheckConfig ¶
func CheckConfig()
CheckConfig() Check configuration file and stop app if config file mot foud or has errors
func CheckForFlags ¶
func CheckForFlags()
func CheckForSign ¶ added in v1.11.5
func CheckForSign()
CheckForSign - check Gufo Sign and if it missing, generate a sign. Sign need to connect to micoservices. By this Sign Microservices understand that requests are from one system
func ConfigString ¶
func ConvertAnyToInterface ¶
func ConvertInterfaceToAny ¶
func CreateConfig ¶
func CreateConfig()
func CreateGravatar ¶ added in v1.15.1
func DecryptConfigPasswords ¶
DecryptConfigPasswords - Decrypt Hashed password in settings file to real password
func DerefString ¶
func EncryptConfigPassword ¶
func ErrorReturn ¶ added in v1.11.5
func GRPCConnect ¶ added in v1.14.0
func GRPCDelete ¶ added in v1.12.2
func HashConfigPasswords ¶
func HashConfigPasswords()
HashConfigPasswords - Change password in settings file to hash
func Interfacetoresponse ¶
func RandomString ¶
func ReadUserIP ¶
requestGetRemoteAddress returns ip address of the client making the request, taking into account http proxies
func SendHTMLEmail ¶
func SetErrorLog ¶
func SetErrorLog(value string)
func ToMapStringInterface ¶
Types ¶
type DBv2 ¶
func DBConnectv2 ¶
type MailRequest ¶
type MailRequest struct {
// contains filtered or unexported fields
}
Request struct
func NewRequest ¶
func NewRequest(to []string, subject, body string, attach []string) *MailRequest
func (*MailRequest) ParseTemplate ¶
func (r *MailRequest) ParseTemplate(templateFileName string, data interface{}) error
func (*MailRequest) SendEmail ¶
func (r *MailRequest) SendEmail(ms *MailSettings) (bool, error)