Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add mapstructure #6

Merged
merged 1 commit into from
Dec 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/kitabisa/smooch
require (
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/gomodule/redigo v2.0.0+incompatible
github.com/mitchellh/mapstructure v1.1.2 // indirect
github.com/stretchr/testify v1.3.0
)

Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm
github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0=
github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
github.com/kitabisa/smooch v0.1.0 h1:dS+ouObVdoNFVZWMIqULMr/VbQoYhsBuSUdmp0VjbcM=
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
Expand Down
18 changes: 9 additions & 9 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,27 +210,27 @@ func (m *Message) MarshalJSON() ([]byte, error) {

// HsmLanguage defines hsm language payload
type HsmLanguage struct {
Policy string `json:"policy"`
Code string `json:"code"`
Policy string `json:"policy" mapstructure:"policy"`
Code string `json:"code" mapstructure:"code"`
}

// HsmLocalizableParams defines hsm localizable params data
type HsmLocalizableParams struct {
Default interface{} `json:"default"`
Default interface{} `json:"default" mapstructure:"default"`
}

// HsmPayload defines payload for hsm
type HsmPayload struct {
Namespace string `json:"namespace"`
ElementName string `json:"element_name"`
Language HsmLanguage `json:"language"`
LocalizableParams []HsmLocalizableParams `json:"localizable_params"`
Namespace string `json:"namespace" mapstructure:"namespace"`
ElementName string `json:"element_name" mapstructure:"element_name"`
Language HsmLanguage `json:"language" mapstructure:"language"`
LocalizableParams []HsmLocalizableParams `json:"localizable_params" mapstructure:"localizable_params"`
}

// HsmMessageBody defines property for HSM message
type HsmMessageBody struct {
Type MessageType `json:"type"`
Hsm HsmPayload `json:"hsm"`
Type MessageType `json:"type" mapstructure:"type"`
Hsm HsmPayload `json:"hsm" mapstructure:"hsm"`
}

// HsmMessage defines struct payload for Whatsapp HSM message
Expand Down