Modify comment syntax error (#5094)
This commit is contained in:
parent
a658b9fbe0
commit
1bb607b286
@ -94,7 +94,7 @@ func (input *BeegoInput) IsHead() bool {
|
|||||||
return (*context.BeegoInput)(input).IsHead()
|
return (*context.BeegoInput)(input).IsHead()
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsOptions Is this a OPTIONS method request?
|
// IsOptions Is this an OPTIONS method request?
|
||||||
func (input *BeegoInput) IsOptions() bool {
|
func (input *BeegoInput) IsOptions() bool {
|
||||||
return (*context.BeegoInput)(input).IsOptions()
|
return (*context.BeegoInput)(input).IsOptions()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,7 +52,7 @@ func (c *Condition) AndCond(cond *Condition) *Condition {
|
|||||||
return (*Condition)((*orm.Condition)(c).AndCond((*orm.Condition)(cond)))
|
return (*Condition)((*orm.Condition)(c).AndCond((*orm.Condition)(cond)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// AndNotCond combine a AND NOT condition to current condition
|
// AndNotCond combine an AND NOT condition to current condition
|
||||||
func (c *Condition) AndNotCond(cond *Condition) *Condition {
|
func (c *Condition) AndNotCond(cond *Condition) *Condition {
|
||||||
return (*Condition)((*orm.Condition)(c).AndNotCond((*orm.Condition)(cond)))
|
return (*Condition)((*orm.Condition)(c).AndNotCond((*orm.Condition)(cond)))
|
||||||
}
|
}
|
||||||
@ -67,12 +67,12 @@ func (c Condition) OrNot(expr string, args ...interface{}) *Condition {
|
|||||||
return (*Condition)((orm.Condition)(c).OrNot(expr, args...))
|
return (*Condition)((orm.Condition)(c).OrNot(expr, args...))
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrCond combine a OR condition to current condition
|
// OrCond combine an OR condition to current condition
|
||||||
func (c *Condition) OrCond(cond *Condition) *Condition {
|
func (c *Condition) OrCond(cond *Condition) *Condition {
|
||||||
return (*Condition)((*orm.Condition)(c).OrCond((*orm.Condition)(cond)))
|
return (*Condition)((*orm.Condition)(c).OrCond((*orm.Condition)(cond)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrNotCond combine a OR NOT condition to current condition
|
// OrNotCond combine an OR NOT condition to current condition
|
||||||
func (c *Condition) OrNotCond(cond *Condition) *Condition {
|
func (c *Condition) OrNotCond(cond *Condition) *Condition {
|
||||||
return (*Condition)((*orm.Condition)(c).OrNotCond((*orm.Condition)(cond)))
|
return (*Condition)((*orm.Condition)(c).OrNotCond((*orm.Condition)(cond)))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,17 +19,17 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var InvalidUrl = berror.DefineCode(4001001, moduleName, "InvalidUrl", `
|
var InvalidUrl = berror.DefineCode(4001001, moduleName, "InvalidUrl", `
|
||||||
You pass a invalid url to httplib module. Please check your url, be careful about special character.
|
You pass an invalid url to httplib module. Please check your url, be careful about special character.
|
||||||
`)
|
`)
|
||||||
|
|
||||||
var InvalidUrlProtocolVersion = berror.DefineCode(4001002, moduleName, "InvalidUrlProtocolVersion", `
|
var InvalidUrlProtocolVersion = berror.DefineCode(4001002, moduleName, "InvalidUrlProtocolVersion", `
|
||||||
You pass a invalid protocol version. In practice, we use HTTP/1.0, HTTP/1.1, HTTP/1.2
|
You pass an invalid protocol version. In practice, we use HTTP/1.0, HTTP/1.1, HTTP/1.2
|
||||||
But something like HTTP/3.2 is valid for client, and the major version is 3, minor version is 2.
|
But something like HTTP/3.2 is valid for client, and the major version is 3, minor version is 2.
|
||||||
but you must confirm that server support those abnormal protocol version.
|
but you must confirm that server support those abnormal protocol version.
|
||||||
`)
|
`)
|
||||||
|
|
||||||
var UnsupportedBodyType = berror.DefineCode(4001003, moduleName, "UnsupportedBodyType", `
|
var UnsupportedBodyType = berror.DefineCode(4001003, moduleName, "UnsupportedBodyType", `
|
||||||
You use a invalid data as request body.
|
You use an invalid data as request body.
|
||||||
For now, we only support type string and byte[].
|
For now, we only support type string and byte[].
|
||||||
`)
|
`)
|
||||||
|
|
||||||
|
|||||||
@ -112,7 +112,7 @@ func Head(url string) *BeegoHTTPRequest {
|
|||||||
return NewBeegoRequest(url, "HEAD")
|
return NewBeegoRequest(url, "HEAD")
|
||||||
}
|
}
|
||||||
|
|
||||||
// BeegoHTTPRequest provides more useful methods than http.Request for requesting a url.
|
// BeegoHTTPRequest provides more useful methods than http.Request for requesting an url.
|
||||||
type BeegoHTTPRequest struct {
|
type BeegoHTTPRequest struct {
|
||||||
url string
|
url string
|
||||||
req *http.Request
|
req *http.Request
|
||||||
|
|||||||
@ -1111,7 +1111,7 @@ func (d *dbBase) ReadBatch(ctx context.Context, q dbQuerier, qs *querySet, mi *m
|
|||||||
ind.Set(mind)
|
ind.Set(mind)
|
||||||
} else {
|
} else {
|
||||||
if cnt == 0 {
|
if cnt == 0 {
|
||||||
// you can use a empty & caped container list
|
// you can use an empty & caped container list
|
||||||
// orm will not replace it
|
// orm will not replace it
|
||||||
if ind.Len() != 0 {
|
if ind.Len() != 0 {
|
||||||
// if container is not empty
|
// if container is not empty
|
||||||
@ -1135,7 +1135,7 @@ func (d *dbBase) ReadBatch(ctx context.Context, q dbQuerier, qs *querySet, mi *m
|
|||||||
ind.Set(slice)
|
ind.Set(slice)
|
||||||
} else {
|
} else {
|
||||||
// when a result is empty and container is nil
|
// when a result is empty and container is nil
|
||||||
// to set a empty container
|
// to set an empty container
|
||||||
if ind.IsNil() {
|
if ind.IsNil() {
|
||||||
ind.Set(reflect.MakeSlice(ind.Type(), 0, 0))
|
ind.Set(reflect.MakeSlice(ind.Type(), 0, 0))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -155,7 +155,7 @@ func (d *dbBaseMysql) InsertOrUpdate(ctx context.Context, q dbQuerier, mi *model
|
|||||||
if isMulti {
|
if isMulti {
|
||||||
qmarks = strings.Repeat(qmarks+"), (", multi-1) + qmarks
|
qmarks = strings.Repeat(qmarks+"), (", multi-1) + qmarks
|
||||||
}
|
}
|
||||||
// conflitValue maybe is a int,can`t use fmt.Sprintf
|
// conflitValue maybe is an int,can`t use fmt.Sprintf
|
||||||
query := fmt.Sprintf("INSERT INTO %s%s%s (%s%s%s) VALUES (%s) %s "+qupdates, Q, mi.table, Q, Q, columns, Q, qmarks, iouStr)
|
query := fmt.Sprintf("INSERT INTO %s%s%s (%s%s%s) VALUES (%s) %s "+qupdates, Q, mi.table, Q, Q, columns, Q, qmarks, iouStr)
|
||||||
|
|
||||||
d.ins.ReplaceMarks(&query)
|
d.ins.ReplaceMarks(&query)
|
||||||
|
|||||||
@ -90,7 +90,7 @@ func (c *Condition) AndCond(cond *Condition) *Condition {
|
|||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
// AndNotCond combine a AND NOT condition to current condition
|
// AndNotCond combine an AND NOT condition to current condition
|
||||||
func (c *Condition) AndNotCond(cond *Condition) *Condition {
|
func (c *Condition) AndNotCond(cond *Condition) *Condition {
|
||||||
c = c.clone()
|
c = c.clone()
|
||||||
if c == cond {
|
if c == cond {
|
||||||
@ -121,7 +121,7 @@ func (c Condition) OrNot(expr string, args ...interface{}) *Condition {
|
|||||||
return &c
|
return &c
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrCond combine a OR condition to current condition
|
// OrCond combine an OR condition to current condition
|
||||||
func (c *Condition) OrCond(cond *Condition) *Condition {
|
func (c *Condition) OrCond(cond *Condition) *Condition {
|
||||||
c = c.clone()
|
c = c.clone()
|
||||||
if c == cond {
|
if c == cond {
|
||||||
@ -133,7 +133,7 @@ func (c *Condition) OrCond(cond *Condition) *Condition {
|
|||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrNotCond combine a OR NOT condition to current condition
|
// OrNotCond combine an OR NOT condition to current condition
|
||||||
func (c *Condition) OrNotCond(cond *Condition) *Condition {
|
func (c *Condition) OrNotCond(cond *Condition) *Condition {
|
||||||
c = c.clone()
|
c = c.clone()
|
||||||
if c == cond {
|
if c == cond {
|
||||||
|
|||||||
@ -257,7 +257,7 @@ func (o *querySet) DeleteWithCtx(ctx context.Context) (int64, error) {
|
|||||||
return o.orm.alias.DbBaser.DeleteBatch(ctx, o.orm.db, o, o.mi, o.cond, o.orm.alias.TZ)
|
return o.orm.alias.DbBaser.DeleteBatch(ctx, o.orm.db, o, o.mi, o.cond, o.orm.alias.TZ)
|
||||||
}
|
}
|
||||||
|
|
||||||
// return a insert queryer.
|
// return an insert queryer.
|
||||||
// it can be used in times.
|
// it can be used in times.
|
||||||
// example:
|
// example:
|
||||||
// i,err := sq.PrepareInsert()
|
// i,err := sq.PrepareInsert()
|
||||||
|
|||||||
@ -405,7 +405,7 @@ type QuerySeter interface {
|
|||||||
// //delete two user who's name is testing1 or testing2
|
// //delete two user who's name is testing1 or testing2
|
||||||
Delete() (int64, error)
|
Delete() (int64, error)
|
||||||
DeleteWithCtx(context.Context) (int64, error)
|
DeleteWithCtx(context.Context) (int64, error)
|
||||||
// return a insert queryer.
|
// return an insert queryer.
|
||||||
// it can be used in times.
|
// it can be used in times.
|
||||||
// example:
|
// example:
|
||||||
// i,err := sq.PrepareInsert()
|
// i,err := sq.PrepareInsert()
|
||||||
|
|||||||
@ -98,7 +98,7 @@ func (ini *IniConfig) parseData(dir string, data []byte) (*IniConfigContainer, e
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
// It might be a good idea to throw a error on all unknonw errors?
|
// It might be a good idea to throw an error on all unknonw errors?
|
||||||
if _, ok := err.(*os.PathError); ok {
|
if _, ok := err.(*os.PathError); ok {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@ -105,11 +105,11 @@ func (el *esLogger) WriteMsg(lm *logs.LogMsg) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Destroy is a empty method
|
// Destroy is an empty method
|
||||||
func (el *esLogger) Destroy() {
|
func (el *esLogger) Destroy() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flush is a empty method
|
// Flush is an empty method
|
||||||
func (el *esLogger) Flush() {
|
func (el *esLogger) Flush() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,7 @@ type siprng struct {
|
|||||||
k0, k1, ctr uint64
|
k0, k1, ctr uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
// siphash implements SipHash-2-4, accepting a uint64 as a message.
|
// siphash implements SipHash-2-4, accepting an uint64 as a message.
|
||||||
func siphash(k0, k1, m uint64) uint64 {
|
func siphash(k0, k1, m uint64) uint64 {
|
||||||
// Initialization.
|
// Initialization.
|
||||||
v0 := k0 ^ 0x736f6d6570736575
|
v0 := k0 ^ 0x736f6d6570736575
|
||||||
|
|||||||
@ -153,7 +153,7 @@ func (input *BeegoInput) IsHead() bool {
|
|||||||
return input.Is("HEAD")
|
return input.Is("HEAD")
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsOptions Is this a OPTIONS method request?
|
// IsOptions Is this an OPTIONS method request?
|
||||||
func (input *BeegoInput) IsOptions() bool {
|
func (input *BeegoInput) IsOptions() bool {
|
||||||
return input.Is("OPTIONS")
|
return input.Is("OPTIONS")
|
||||||
}
|
}
|
||||||
|
|||||||
@ -98,7 +98,7 @@ func encrypt(block cipher.Block, value []byte) ([]byte, error) {
|
|||||||
|
|
||||||
// decrypt decrypts a value using the given block in counter mode.
|
// decrypt decrypts a value using the given block in counter mode.
|
||||||
//
|
//
|
||||||
// The value to be decrypted must be prepended by a initialization vector
|
// The value to be decrypted must be prepended by an initialization vector
|
||||||
// (http://goo.gl/zF67k) with the length of the block size.
|
// (http://goo.gl/zF67k) with the length of the block size.
|
||||||
func decrypt(block cipher.Block, value []byte) ([]byte, error) {
|
func decrypt(block cipher.Block, value []byte) ([]byte, error) {
|
||||||
size := block.BlockSize()
|
size := block.BlockSize()
|
||||||
|
|||||||
@ -103,7 +103,7 @@ func init() {
|
|||||||
beegoTplFuncMap["lt"] = lt // <
|
beegoTplFuncMap["lt"] = lt // <
|
||||||
beegoTplFuncMap["ne"] = ne // !=
|
beegoTplFuncMap["ne"] = ne // !=
|
||||||
|
|
||||||
beegoTplFuncMap["urlfor"] = URLFor // build a URL to match a Controller and it's method
|
beegoTplFuncMap["urlfor"] = URLFor // build an URL to match a Controller and it's method
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddFuncMap let user to register a func in the template.
|
// AddFuncMap let user to register a func in the template.
|
||||||
|
|||||||
@ -221,7 +221,7 @@ func (f optionFunc) apply(t *Task) {
|
|||||||
f(t)
|
f(t)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TimeoutOption return a option to set timeout duration for task
|
// TimeoutOption return an option to set timeout duration for task
|
||||||
func TimeoutOption(timeout time.Duration) Option {
|
func TimeoutOption(timeout time.Duration) Option {
|
||||||
return optionFunc(func(t *Task) {
|
return optionFunc(func(t *Task) {
|
||||||
t.Timeout = timeout
|
t.Timeout = timeout
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user