aboutsummaryrefslogtreecommitdiff
path: root/models/login_source.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2018-06-09 17:32:58 +0800
committerUnknwon <u@gogs.io>2018-06-09 17:32:58 +0800
commitfbecc18e2e4d4eb863a990a57218305f190ae6db (patch)
tree11278a833eec45d8bf710f4e6e27481975b96eaa /models/login_source.go
parentb538c5345e1271fcaf413b82ba1ece555dd635a5 (diff)
*: use jsoniter to replace encoding/json
Diffstat (limited to 'models/login_source.go')
-rw-r--r--models/login_source.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/models/login_source.go b/models/login_source.go
index e72aa496..88ad42dc 100644
--- a/models/login_source.go
+++ b/models/login_source.go
@@ -6,7 +6,6 @@ package models
import (
"crypto/tls"
- "encoding/json"
"fmt"
"net/smtp"
"net/textproto"
@@ -20,6 +19,7 @@ import (
"github.com/go-macaron/binding"
"github.com/go-xorm/core"
"github.com/go-xorm/xorm"
+ "github.com/json-iterator/go"
log "gopkg.in/clog.v1"
"gopkg.in/ini.v1"
@@ -66,11 +66,11 @@ type LDAPConfig struct {
}
func (cfg *LDAPConfig) FromDB(bs []byte) error {
- return json.Unmarshal(bs, &cfg)
+ return jsoniter.Unmarshal(bs, &cfg)
}
func (cfg *LDAPConfig) ToDB() ([]byte, error) {
- return json.Marshal(cfg)
+ return jsoniter.Marshal(cfg)
}
func (cfg *LDAPConfig) SecurityProtocolName() string {
@@ -87,11 +87,11 @@ type SMTPConfig struct {
}
func (cfg *SMTPConfig) FromDB(bs []byte) error {
- return json.Unmarshal(bs, cfg)
+ return jsoniter.Unmarshal(bs, cfg)
}
func (cfg *SMTPConfig) ToDB() ([]byte, error) {
- return json.Marshal(cfg)
+ return jsoniter.Marshal(cfg)
}
type PAMConfig struct {
@@ -99,11 +99,11 @@ type PAMConfig struct {
}
func (cfg *PAMConfig) FromDB(bs []byte) error {
- return json.Unmarshal(bs, &cfg)
+ return jsoniter.Unmarshal(bs, &cfg)
}
func (cfg *PAMConfig) ToDB() ([]byte, error) {
- return json.Marshal(cfg)
+ return jsoniter.Marshal(cfg)
}
// AuthSourceFile contains information of an authentication source file.