Documentation
¶
Index ¶
- func JsonParse(obj any, data string) error
- func JsonStringify(data any) string
- func PIN(length int) string
- func ParseCSVFile(filename string, result any) error
- func ParseExcelFile(filename string, result any) error
- func ParseJSONFile(filename string, result any) error
- func ParseStruct(obj any, data any, tag string) error
- func UUID() string
- func Upload(location string, file multipart.File, header *multipart.FileHeader) string
- type Elastable
- type ElasticClient
- func (ec *ElasticClient) Delete(data Elastable) error
- func (ec *ElasticClient) DeleteById(table string, id any) error
- func (ec *ElasticClient) Save(data Elastable) error
- func (ec *ElasticClient) Search(obj any, table, value string, keys ...string)
- func (ec *ElasticClient) Update(data Elastable) error
- type Encryption
- type HTTPFetcher
- type JSON
- type Mailer
- func (m *Mailer) AttachFile(filename string, data []byte) error
- func (m *Mailer) Bcc(emails ...string)
- func (m *Mailer) Cc(emails ...string)
- func (m *Mailer) Close()
- func (m *Mailer) From(from string)
- func (m *Mailer) Recipients(emails ...string)
- func (m *Mailer) Send() error
- func (m *Mailer) SetHTML(content string) error
- func (m *Mailer) SetHTMLFile(file string, data any) error
- func (m *Mailer) SetText(text string) error
- func (m *Mailer) Subject(subject string)
- type RabbitMQ
- type WebSocket
- func (s *WebSocket) AuthorizeNewClient(authorizeNewClient func(token string) bool)
- func (s *WebSocket) Blast(m string) error
- func (s *WebSocket) Client() error
- func (s *WebSocket) Command(data WebSocketMessage) error
- func (s *WebSocket) Disconnect() error
- func (s *WebSocket) OnCommand(handle func(m WebSocketMessage))
- func (s *WebSocket) OnMessage(handle func(m WebSocketMessage))
- func (s *WebSocket) Reply(m WebSocketMessage, message string) error
- func (s *WebSocket) Send(to string, msg string) error
- func (s *WebSocket) Server(secret, iv string) error
- type WebSocketMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JsonStringify ¶ added in v1.0.1
Convert map / struct / slice to string
func ParseCSVFile ¶
parsing csv file to struct / map / slice
func ParseExcelFile ¶
parsing excel file to struct / map / slice
func ParseJSONFile ¶
parsing json file to struct / map / slice
func ParseStruct ¶
parse map data to struct with custom struct tag
Types ¶
type ElasticClient ¶
type ElasticClient struct {
// contains filtered or unexported fields
}
Base Elastic Client Struct
func NewElasticSearch ¶
func NewElasticSearch(uri string) (*ElasticClient, error)
Create new Elastic Client
func (*ElasticClient) Delete ¶
func (ec *ElasticClient) Delete(data Elastable) error
Delete Data By Model
func (*ElasticClient) DeleteById ¶
func (ec *ElasticClient) DeleteById(table string, id any) error
Delete Data by Id
func (*ElasticClient) Search ¶
func (ec *ElasticClient) Search(obj any, table, value string, keys ...string)
search data
func (*ElasticClient) Update ¶
func (ec *ElasticClient) Update(data Elastable) error
Update Data by model
type Encryption ¶
type Encryption struct {
// contains filtered or unexported fields
}
basae encryption model
type HTTPFetcher ¶
base http fetcher
type Mailer ¶
type Mailer struct {
// contains filtered or unexported fields
}
mailer base model
func (*Mailer) AttachFile ¶
attach file to mail
func (*Mailer) SetHTMLFile ¶
set mail html file with data
type RabbitMQ ¶
type RabbitMQ struct {
// contains filtered or unexported fields
}
rabbit mq base model
func NewRabbitMQ ¶
create new rabbit mq instance
type WebSocket ¶
type WebSocket struct {
// contains filtered or unexported fields
}
websocket base model
func (*WebSocket) AuthorizeNewClient ¶ added in v1.0.2
Server Must Authorize New Client
func (*WebSocket) Command ¶
func (s *WebSocket) Command(data WebSocketMessage) error
Client Send Command
func (*WebSocket) OnCommand ¶
func (s *WebSocket) OnCommand(handle func(m WebSocketMessage))
Handle Command On Server
func (*WebSocket) OnMessage ¶
func (s *WebSocket) OnMessage(handle func(m WebSocketMessage))
Client On Message Received
func (*WebSocket) Reply ¶
func (s *WebSocket) Reply(m WebSocketMessage, message string) error
Server Send Reply Message
Click to show internal directories.
Click to hide internal directories.