Documentation ¶
Index ¶
- Constants
- Variables
- func AppendStrings(strings ...string) string
- func CreateApiKey() string
- func CreateUuid() string
- func GenerateToken(n int) string
- func IsUrl(checkUrl string) error
- func IsValidId(id string) bool
- func Join(stringSlice []string, delimiter string, enclosure string) string
- func MakePrepareForInExpression(target interface{}) (string, map[string]interface{})
- func MergeMap(baseMap map[string]interface{}, mergeMaps ...map[string]interface{}) map[string]interface{}
- func RemoveDuplicate(args []string) []string
- func SearchStringValueInSlice(slice []string, value string) bool
- type Config
- type Datastore
- type Dispatcher
- type JSONText
- type Logging
- type Notification
- type Rtm
- type ServerInfo
- type Storage
- type WorkFunc
Constants ¶
View Source
const ( APP_NAME = "swagchat-api" API_VERSION = "v0" BUILD_VERSION = "v0.9.1" KEY_LENGTH = 32 TOKEN_LENGTH = 32 HEADER_API_KEY = "X-SwagChat-Api-Key" HEADER_API_SECRET = "X-SwagChat-Api-Secret" HEADER_USER_ID = "X-SwagChat-User-Id" )
Variables ¶
View Source
var ( Cfg *Config IsShowVersion bool )
View Source
var AppLogger *zap.Logger
Functions ¶
func AppendStrings ¶
func CreateApiKey ¶ added in v0.6.0
func CreateApiKey() string
func CreateUuid ¶
func CreateUuid() string
func GenerateToken ¶ added in v0.5.0
func RemoveDuplicate ¶
func SearchStringValueInSlice ¶ added in v0.2.0
Types ¶
type Datastore ¶ added in v0.4.0
type Datastore struct { Provider string TableNamePrefix string `yaml:"tableNamePrefix"` // SQLite SqlitePath string `yaml:"sqlitePath"` // MySQL, GCP SQL User string Password string Database string MaxIdleConnection string `yaml:"maxIdleConnection"` MaxOpenConnection string `yaml:"maxOpenConnection"` Master *ServerInfo Replicas []*ServerInfo }
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func NewDispatcher ¶
func NewDispatcher(max int) *Dispatcher
func (*Dispatcher) Wait ¶
func (d *Dispatcher) Wait()
type JSONText ¶
type JSONText json.RawMessage
func (JSONText) MarshalJSON ¶
MarshalJSON returns j as the JSON encoding of j.
func (*JSONText) UnmarshalJSON ¶
UnmarshalJSON sets *j to a copy of data
type Notification ¶ added in v0.4.0
type Notification struct { Provider string RoomTopicNamePrefix string `yaml:"roomTopicNamePrefix"` DefaultBadgeCount string `yaml:"defaultBadgeCount"` // AWS SNS AwsRegion string `yaml:"awsRegion"` AwsAccessKeyId string `yaml:"awsAccessKeyId"` AwsSecretAccessKey string `yaml:"awsSecretAccessKey"` AwsApplicationArnIos string `yaml:"awsApplicationArnIos"` AwsApplicationArnAndroid string `yaml:"awsApplicationArnAndroid"` }
type ServerInfo ¶ added in v0.9.1
type Storage ¶ added in v0.4.0
type Storage struct { Provider string // Local BaseUrl string `yaml:"baseUrl"` LocalPath string `yaml:"localPath"` // GCP Storage, AWS S3 UploadBucket string `yaml:"uploadBucket"` UploadDirectory string `yaml:"uploadDirectory"` ThumbnailBucket string `yaml:"thumbnailBucket"` ThumbnailDirectory string `yaml:"thumbnailDirectory"` // GCP Storage GcpProjectId string `yaml:"gcpProjectId"` GcpJwtPath string `yaml:"gcpJwtPath"` // AWS S3 AwsRegion string `yaml:"awsRegion"` AwsAccessKeyId string `yaml:"awsAccessKeyId"` AwsSecretAccessKey string `yaml:"awsSecretAccessKey"` }
Click to show internal directories.
Click to hide internal directories.