mirror of
https://github.com/retailcrm/mg-transport-core.git
synced 2024-11-22 05:06:04 +03:00
Update product name, cleanup annotations (#22)
This commit is contained in:
parent
cc4e3b0957
commit
2eb1b78871
@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2019 RetailDriver LLC
|
Copyright (c) 2019-2020 RetailDriver LLC
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
12
README.md
12
README.md
@ -1,11 +1,13 @@
|
|||||||
## Message Gateway Transport Library
|
## Message Gateway Transport Library
|
||||||
[![Build Status](https://github.com/retailcrm/mg-transport-core/workflows/ci/badge.svg)](https://github.com/retailcrm/mg-transport-core/actions?query=workflow%3Aci)
|
[![Build Status](https://github.com/retailcrm/mg-transport-core/workflows/ci/badge.svg)](https://github.com/retailcrm/mg-transport-core/actions?query=workflow%3Aci)
|
||||||
[![codecov](https://codecov.io/gh/retailcrm/mg-transport-core/branch/master/graph/badge.svg)](https://codecov.io/gh/retailcrm/mg-transport-core)
|
[![Coverage](https://codecov.io/gh/retailcrm/mg-transport-core/branch/master/graph/badge.svg?logo=codecov&logoColor=white)](https://codecov.io/gh/retailcrm/mg-transport-core)
|
||||||
[![pkg.go.dev](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white)](https://pkg.go.dev/github.com/retailcrm/mg-transport-core/core)
|
[![GitHub release](https://img.shields.io/github/release/retailcrm/mg-transport-core.svg?logo=github&logoColor=white)](https://github.com/retailcrm/mg-transport-core/releases)
|
||||||
[![Go Report Card](https://goreportcard.com/badge/github.com/retailcrm/mg-transport-core)](https://goreportcard.com/report/github.com/retailcrm/mg-transport-core)
|
[![Go Report Card](https://goreportcard.com/badge/github.com/retailcrm/mg-transport-core)](https://goreportcard.com/report/github.com/retailcrm/mg-transport-core)
|
||||||
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/retailcrm/mg-transport-core/blob/master/LICENSE.md)
|
[![GoLang version](https://img.shields.io/badge/go->=1.12-blue.svg?logo=go&logoColor=white)](https://golang.org/dl/)
|
||||||
|
[![pkg.go.dev](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white)](https://pkg.go.dev/github.com/retailcrm/mg-transport-core/core)
|
||||||
|
|
||||||
This library provides different functions like error-reporting, logging, localization, etc. in order to make it easier to create transports.
|
This library provides different functions like error-reporting, logging, localization, etc. in order to make it easier to create transports.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
```go
|
```go
|
||||||
package main
|
package main
|
||||||
@ -61,7 +63,9 @@ func main() {
|
|||||||
### Resource embedding
|
### Resource embedding
|
||||||
[packr](https://github.com/gobuffalo/packr/tree/master/v2) can be used to provide resource embedding. In order to use packr you must follow
|
[packr](https://github.com/gobuffalo/packr/tree/master/v2) can be used to provide resource embedding. In order to use packr you must follow
|
||||||
[this instruction](https://github.com/gobuffalo/packr/tree/master/v2#library-installation), and provide boxes with templates,
|
[this instruction](https://github.com/gobuffalo/packr/tree/master/v2#library-installation), and provide boxes with templates,
|
||||||
translations and assets to library. Example:
|
translations and assets to library.
|
||||||
|
|
||||||
|
Example:
|
||||||
```go
|
```go
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ func (u *Utils) GenerateToken() string {
|
|||||||
return fmt.Sprintf("%x", sha256.Sum256([]byte(fmt.Sprintf("%d%d", time.Now().UnixNano(), c))))
|
return fmt.Sprintf("%x", sha256.Sum256([]byte(fmt.Sprintf("%d%d", time.Now().UnixNano(), c))))
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetAPIClient will initialize retailCRM api client from url and key
|
// GetAPIClient will initialize RetailCRM api client from url and key
|
||||||
func (u *Utils) GetAPIClient(url, key string) (*v5.Client, int, error) {
|
func (u *Utils) GetAPIClient(url, key string) (*v5.Client, int, error) {
|
||||||
client := v5.New(url, key)
|
client := v5.New(url, key)
|
||||||
client.Debug = u.IsDebug
|
client.Debug = u.IsDebug
|
||||||
|
@ -17,7 +17,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
testCRMURL = "https://fake-uri.retailcrm.ru"
|
testCRMURL = "https://fake-uri.retailcrm.pro"
|
||||||
testMGURL = "https://mg-url.example.com"
|
testMGURL = "https://mg-url.example.com"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user