aboutsummaryrefslogtreecommitdiff
path: root/mxlib
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-02-17 19:02:26 +0100
committerAlex Auvolat <alex@adnab.me>2020-02-17 19:02:26 +0100
commita4dd3b310d68f5c6147bdeaf8ecd3556c2cf7859 (patch)
tree14d4dbdcc03803f4a40b06f2862bce78df318a76 /mxlib
parent531b59bf953ad6c1fb7adfb6554dcc412fbe47e5 (diff)
downloadeasybridge-a4dd3b310d68f5c6147bdeaf8ecd3556c2cf7859.tar.gz
easybridge-a4dd3b310d68f5c6147bdeaf8ecd3556c2cf7859.zip
Go fmt
Diffstat (limited to 'mxlib')
-rw-r--r--mxlib/api.go45
-rw-r--r--mxlib/registration.go20
2 files changed, 32 insertions, 33 deletions
diff --git a/mxlib/api.go b/mxlib/api.go
index de5b424..c7061b3 100644
--- a/mxlib/api.go
+++ b/mxlib/api.go
@@ -6,7 +6,7 @@ import (
type MxError struct {
ErrCode string `json:"errcode"`
- ErrMsg string `json:"error"`
+ ErrMsg string `json:"error"`
}
func (e *MxError) Error() string {
@@ -18,12 +18,12 @@ type Transaction struct {
}
type Event struct {
- Content map[string]interface{} `json:"content"`
- Type string `json:"type"`
- EventId string `json:"event_id"`
- RoomId string `json:"room_id"`
- Sender string `json:"sender"`
- OriginServerTs int `json:"origin_server_ts"`
+ Content map[string]interface{} `json:"content"`
+ Type string `json:"type"`
+ EventId string `json:"event_id"`
+ RoomId string `json:"room_id"`
+ Sender string `json:"sender"`
+ OriginServerTs int `json:"origin_server_ts"`
}
type RegisterRequest struct {
@@ -31,9 +31,9 @@ type RegisterRequest struct {
}
type RegisterResponse struct {
- UserId string `json:"user_id"`
+ UserId string `json:"user_id"`
AccessToken string `json:"access_token"`
- DeviceId string `json:"device_id"`
+ DeviceId string `json:"device_id"`
}
type ProfileDisplaynameRequest struct {
@@ -41,23 +41,23 @@ type ProfileDisplaynameRequest struct {
}
type CreateRoomRequest struct {
- Preset string `json:"preset"`
- RoomAliasName string `json:"room_alias_name"`
- Name string `json:"name"`
- Topic string `json:"topic"`
- Invite []string `json:"invite"`
+ Preset string `json:"preset"`
+ RoomAliasName string `json:"room_alias_name"`
+ Name string `json:"name"`
+ Topic string `json:"topic"`
+ Invite []string `json:"invite"`
CreationContent map[string]interface{} `json:"creation_content"`
- PowerLevels map[string]interface{} `json:"power_level_content_override"`
+ PowerLevels map[string]interface{} `json:"power_level_content_override"`
}
type CreateRoomNoAliasRequest struct {
- Preset string `json:"preset"`
- Name string `json:"name"`
- Topic string `json:"topic"`
- Invite []string `json:"invite"`
+ Preset string `json:"preset"`
+ Name string `json:"name"`
+ Topic string `json:"topic"`
+ Invite []string `json:"invite"`
CreationContent map[string]interface{} `json:"creation_content"`
- PowerLevels map[string]interface{} `json:"power_level_content_override"`
- IsDirect bool `json:"is_direct"`
+ PowerLevels map[string]interface{} `json:"power_level_content_override"`
+ IsDirect bool `json:"is_direct"`
}
type CreateRoomResponse struct {
@@ -65,7 +65,7 @@ type CreateRoomResponse struct {
}
type DirectoryRoomResponse struct {
- RoomId string `json:"room_id"`
+ RoomId string `json:"room_id"`
Servers []string `json:"string"`
}
@@ -84,4 +84,3 @@ type RoomJoinResponse struct {
type RoomSendResponse struct {
EventId string `json:"event_id"`
}
-
diff --git a/mxlib/registration.go b/mxlib/registration.go
index d4b18dc..cae3f29 100644
--- a/mxlib/registration.go
+++ b/mxlib/registration.go
@@ -5,21 +5,21 @@ import (
)
type Registration struct {
- Id string `yaml:"id"`
- Url string `yaml:"url"`
- AsToken string `yaml:"as_token"`
- HsToken string `yaml:"hs_token"`
- SenderLocalpart string `yaml:"sender_localpart"`
- Namespaces RegistrationNamespaceSet `yaml:"namespaces"`
+ Id string `yaml:"id"`
+ Url string `yaml:"url"`
+ AsToken string `yaml:"as_token"`
+ HsToken string `yaml:"hs_token"`
+ SenderLocalpart string `yaml:"sender_localpart"`
+ Namespaces RegistrationNamespaceSet `yaml:"namespaces"`
}
type RegistrationNamespaceSet struct {
- Users []RegistrationNamespace `yaml:"users"`
+ Users []RegistrationNamespace `yaml:"users"`
Aliases []RegistrationNamespace `yaml:"aliases"`
- Rooms []RegistrationNamespace `yaml:"rooms"`
+ Rooms []RegistrationNamespace `yaml:"rooms"`
}
type RegistrationNamespace struct {
- Exclusive bool `yaml:"exclusive"`
- Regex string `yaml:"regex"`
+ Exclusive bool `yaml:"exclusive"`
+ Regex string `yaml:"regex"`
}