mirror of
https://codeberg.org/superseriousbusiness/gotosocial.git
synced 2024-12-27 03:18:16 +03:00
7cc40302a5
* add miekg/dns dependency * set/validate accountDomain * move finger to dereferencer * totally break GetRemoteAccount * start reworking finger func a bit * start reworking getRemoteAccount a bit * move mention parts to namestring * rework webfingerget * use util function to extract webfinger parts * use accountDomain * rework finger again, final form * just a real nasty commit, the worst * remove refresh from account * use new ASRepToAccount signature * fix incorrect debug call * fix for new getRemoteAccount * rework GetRemoteAccount * start updating tests to remove repetition * break a lot of tests Move shared test logic into the testrig, rather than having it scattered all over the place. This allows us to just mock the transport controller once, and have all tests use it (unless they need not to for some other reason). * fix up tests to use main mock httpclient * webfinger only if necessary * cheeky linting with the lads * update mentionName regex recognize instance accounts * don't finger instance accounts * test webfinger part extraction * increase default worker count to 4 per cpu * don't repeat regex parsing * final search for discovered accountDomain * be more permissive in namestring lookup * add more extraction tests * simplify GetParseMentionFunc * skip long search if local account * fix broken test * consolidate to all use same caching libraries Signed-off-by: kim <grufwub@gmail.com> * perform more caching in the database layer Signed-off-by: kim <grufwub@gmail.com> * remove ASNote cache Signed-off-by: kim <grufwub@gmail.com> * update cache library, improve db tracing hooks Signed-off-by: kim <grufwub@gmail.com> * return ErrNoEntries if no account status IDs found, small formatting changes Signed-off-by: kim <grufwub@gmail.com> * fix tests, thanks tobi! Signed-off-by: kim <grufwub@gmail.com> Co-authored-by: tsmethurst <tobi.smethurst@protonmail.com>
50 lines
1.7 KiB
Go
50 lines
1.7 KiB
Go
// Copyright 2021 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// Package constraints defines a set of useful constraints to be used
|
|
// with type parameters.
|
|
package constraints
|
|
|
|
// Signed is a constraint that permits any signed integer type.
|
|
// If future releases of Go add new predeclared signed integer types,
|
|
// this constraint will be modified to include them.
|
|
type Signed interface {
|
|
~int | ~int8 | ~int16 | ~int32 | ~int64
|
|
}
|
|
|
|
// Unsigned is a constraint that permits any unsigned integer type.
|
|
// If future releases of Go add new predeclared unsigned integer types,
|
|
// this constraint will be modified to include them.
|
|
type Unsigned interface {
|
|
~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
|
|
}
|
|
|
|
// Integer is a constraint that permits any integer type.
|
|
// If future releases of Go add new predeclared integer types,
|
|
// this constraint will be modified to include them.
|
|
type Integer interface {
|
|
Signed | Unsigned
|
|
}
|
|
|
|
// Float is a constraint that permits any floating-point type.
|
|
// If future releases of Go add new predeclared floating-point types,
|
|
// this constraint will be modified to include them.
|
|
type Float interface {
|
|
~float32 | ~float64
|
|
}
|
|
|
|
// Complex is a constraint that permits any complex numeric type.
|
|
// If future releases of Go add new predeclared complex numeric types,
|
|
// this constraint will be modified to include them.
|
|
type Complex interface {
|
|
~complex64 | ~complex128
|
|
}
|
|
|
|
// Ordered is a constraint that permits any ordered type: any type
|
|
// that supports the operators < <= >= >.
|
|
// If future releases of Go add new ordered types,
|
|
// this constraint will be modified to include them.
|
|
type Ordered interface {
|
|
Integer | Float | ~string
|
|
}
|