Documentation ¶
Index ¶
- Constants
- func CheckClear(c *client.Forum)
- func CheckForum(c *client.Forum, forum *models.Forum)
- func CheckForumCreateConflict(c *client.Forum, m *Modify)
- func CheckForumCreateSimple(c *client.Forum)
- func CheckForumCreateUnicode(c *client.Forum)
- func CheckForumCreateUserCase(c *client.Forum, m *Modify)
- func CheckForumCreateUserNotFound(c *client.Forum)
- func CheckForumGetOneNocase(c *client.Forum, m *Modify)
- func CheckForumGetOneNotFound(c *client.Forum)
- func CheckForumGetOneSimple(c *client.Forum)
- func CheckForumGetThreadsNotFound(c *client.Forum, m *Modify)
- func CheckForumGetThreadsSimple(c *client.Forum, m *Modify)
- func CheckForumGetUsersCollation(c *client.Forum, m *Modify)
- func CheckForumGetUsersEmpty(c *client.Forum, m *Modify)
- func CheckForumGetUsersNotFound(c *client.Forum, m *Modify)
- func CheckForumGetUsersSimple(c *client.Forum, m *Modify)
- func CheckForumGetUsersVote(c *client.Forum, m *Modify)
- func CheckIsType(expectedType interface{}, object interface{})
- func CheckNil(err interface{})
- func CheckPost(c *client.Forum, post *models.Post)
- func CheckPostCreateDeepParent(c *client.Forum)
- func CheckPostCreateEmpty(c *client.Forum, m *Modify)
- func CheckPostCreateInvalidParent(c *client.Forum, m *Modify)
- func CheckPostCreateNoAuthor(c *client.Forum, m *Modify)
- func CheckPostCreateNoThread(c *client.Forum, m *Modify)
- func CheckPostCreateSimple(c *client.Forum, m *Modify)
- func CheckPostCreateUnicode(c *client.Forum)
- func CheckPostCreateWithParent(c *client.Forum)
- func CheckPostGetOneNotFound(c *client.Forum, m *Modify)
- func CheckPostGetOneRelated(c *client.Forum, m *Modify)
- func CheckPostGetOneSimple(c *client.Forum)
- func CheckPostUpdateCase(c *client.Forum)
- func CheckPostUpdateEmpty(c *client.Forum)
- func CheckPostUpdateNotFound(c *client.Forum)
- func CheckPostUpdateSame(c *client.Forum)
- func CheckPostUpdateSimple(c *client.Forum)
- func CheckStatus(c *client.Forum)
- func CheckThread(c *client.Forum, thread *models.Thread)
- func CheckThreadCreateConflict(c *client.Forum, m *Modify)
- func CheckThreadCreateNoAuthor(c *client.Forum)
- func CheckThreadCreateNoCase(c *client.Forum, m *Modify)
- func CheckThreadCreateNoForum(c *client.Forum)
- func CheckThreadCreateSimple(c *client.Forum, m *Modify)
- func CheckThreadCreateUnicode(c *client.Forum)
- func CheckThreadGetOneNotFound(c *client.Forum)
- func CheckThreadGetOneSimple(c *client.Forum, m *Modify)
- func CheckThreadGetPostsNotFound(c *client.Forum)
- func CheckThreadGetPostsSimple(c *client.Forum, m *Modify)
- func CheckThreadUpdateEmpty(c *client.Forum)
- func CheckThreadUpdateNotFound(c *client.Forum)
- func CheckThreadUpdatePart(c *client.Forum, m *Modify)
- func CheckThreadUpdateSimple(c *client.Forum, m *Modify)
- func CheckThreadVoteSimple(c *client.Forum)
- func CheckThreadVoteThreadNotFound(c *client.Forum)
- func CheckThreadVoteUserNotFound(c *client.Forum)
- func CheckUser(c *client.Forum, user *models.User)
- func CheckUserCreateConflict(c *client.Forum, m *Modify)
- func CheckUserCreateSimple(c *client.Forum)
- func CheckUserCreateUnicode(c *client.Forum)
- func CheckUserGetOneNocase(c *client.Forum, m *Modify)
- func CheckUserGetOneNotFound(c *client.Forum)
- func CheckUserGetOneSimple(c *client.Forum)
- func CheckUserUpdateConflict(c *client.Forum, m *Modify)
- func CheckUserUpdateEmpty(c *client.Forum)
- func CheckUserUpdateNotFound(c *client.Forum)
- func CheckUserUpdatePart(c *client.Forum, m *Modify)
- func CheckUserUpdateSimple(c *client.Forum)
- func Checkpoint(c *client.Forum, message string) bool
- func Colorize(color int, message string) string
- func CreateForum(c *client.Forum, forum *models.Forum, owner *models.User) *models.Forum
- func CreatePost(c *client.Forum, post *models.Post, thread *models.Thread) *models.Post
- func CreatePosts(c *client.Forum, posts []*models.Post, thread *models.Thread) []*models.Post
- func CreateThread(c *client.Forum, thread *models.Thread, forum *models.Forum, ...) *models.Thread
- func CreateTransport(url *url.URL) *http_transport.Runtime
- func CreateUser(c *client.Forum, user *models.User) *models.User
- func DeltaToHtml(delta []difflib.DiffRecord) string
- func DeltaToText(delta []difflib.DiffRecord) string
- func Expected(statusCode int, body interface{}, prepare Filter) context.Context
- func Fill(url *url.URL) int
- func FillUsers(c *client.Forum, parallel int, count int) []*models.User
- func GetBody(stream *io.ReadCloser) ([]byte, error)
- func GetDelta(data []byte, expected interface{}, prepare Filter) *[]difflib.DiffRecord
- func GetDiff(actual string, expected string) *[]difflib.DiffRecord
- func InvertCase(str string) string
- func Modifications(checker func(c *client.Forum, modify *Modify)) func(c *client.Forum)
- func ObjectsAreEqual(expected, actual interface{}) bool
- func PrettyJson(body string) string
- func RandomEmail() strfmt.Email
- func RandomForum() *models.Forum
- func RandomMarker() string
- func RandomNickname() string
- func RandomPost() *models.Post
- func RandomThread() *models.Thread
- func RandomTime() time.Time
- func RandomUser() *models.User
- func Register(checker Checker)
- func Run(url *url.URL, mask *regexp.Regexp, report_file string, keep bool) int
- func RunCheck(check Checker, report *Report, url *url.URL)
- func SortPosts(posts []OrderedPost, desc bool, limitType func(OrderedPost) int, limit int) [][]*models.Post
- func ToJson(obj interface{}) string
- type Abc
- type Checker
- type CheckerByName
- type CheckerTransport
- type Filter
- type Modify
- type OrderedPost
- type PostSortTree
- type Report
- type ReportHttp
- type ReportMessage
- type ReportPass
- type ResultType
- type Shortid
- type ThreadByCreated
- type UserByNickname
- type Validator
Constants ¶
const ( KEY_STATUS = "expected-status" KEY_BODY = "expected-body" KEY_FILTER = "expected-filter" )
const ABC_NICK = "0123456789abcdefghijklmnopqrstuvwxyz_."
const ABC_SLUG = "0123456789abcdefghijklmnopqrstuvwxyz_-"
const POST_FAKE_ID int64 = 2139800938
const THREAD_FAKE_ID = "2139800939"
Variables ¶
This section is empty.
Functions ¶
func CheckClear ¶ added in v0.1.0
func CheckForumCreateSimple ¶
func CheckForumCreateUnicode ¶
func CheckForumGetOneNocase ¶
func CheckForumGetOneSimple ¶
func CheckForumGetThreadsNotFound ¶ added in v0.1.0
func CheckForumGetThreadsSimple ¶ added in v0.1.0
func CheckForumGetUsersCollation ¶ added in v0.2.0
func CheckForumGetUsersEmpty ¶ added in v0.1.0
func CheckForumGetUsersNotFound ¶ added in v0.1.0
func CheckForumGetUsersSimple ¶ added in v0.1.0
func CheckForumGetUsersVote ¶ added in v0.1.0
func CheckIsType ¶
func CheckIsType(expectedType interface{}, object interface{})
func CheckPostCreateDeepParent ¶ added in v0.1.0
func CheckPostCreateEmpty ¶ added in v0.1.0
func CheckPostCreateInvalidParent ¶ added in v0.1.0
func CheckPostCreateNoAuthor ¶ added in v0.1.0
func CheckPostCreateNoThread ¶ added in v0.1.0
func CheckPostCreateSimple ¶
func CheckPostCreateUnicode ¶ added in v0.1.0
func CheckPostCreateWithParent ¶ added in v0.1.0
func CheckPostGetOneNotFound ¶ added in v0.1.0
func CheckPostGetOneRelated ¶ added in v0.1.0
func CheckPostGetOneSimple ¶ added in v0.1.0
func CheckPostUpdateCase ¶ added in v0.1.0
func CheckPostUpdateEmpty ¶ added in v0.1.0
func CheckPostUpdateNotFound ¶ added in v0.1.0
func CheckPostUpdateSame ¶ added in v0.1.0
func CheckPostUpdateSimple ¶ added in v0.1.0
func CheckStatus ¶ added in v0.1.0
func CheckThreadCreateConflict ¶ added in v0.1.0
func CheckThreadCreateNoAuthor ¶ added in v0.1.0
func CheckThreadCreateNoCase ¶ added in v0.1.0
func CheckThreadCreateNoForum ¶ added in v0.1.0
func CheckThreadCreateSimple ¶
func CheckThreadCreateUnicode ¶ added in v0.1.0
func CheckThreadGetOneNotFound ¶ added in v0.1.0
func CheckThreadGetOneSimple ¶ added in v0.1.0
func CheckThreadGetPostsNotFound ¶ added in v0.1.0
func CheckThreadGetPostsSimple ¶ added in v0.1.0
func CheckThreadUpdateEmpty ¶ added in v0.1.0
func CheckThreadUpdateNotFound ¶ added in v0.1.0
func CheckThreadUpdatePart ¶ added in v0.1.0
func CheckThreadUpdateSimple ¶ added in v0.1.0
func CheckThreadVoteSimple ¶ added in v0.1.0
func CheckThreadVoteThreadNotFound ¶ added in v0.1.0
func CheckThreadVoteUserNotFound ¶ added in v0.1.0
func CheckUserCreateConflict ¶
func CheckUserCreateSimple ¶
func CheckUserCreateUnicode ¶
func CheckUserGetOneNocase ¶
func CheckUserGetOneNotFound ¶
func CheckUserGetOneSimple ¶
func CheckUserUpdateConflict ¶
func CheckUserUpdateEmpty ¶
func CheckUserUpdateNotFound ¶
func CheckUserUpdatePart ¶
func CheckUserUpdateSimple ¶
func CreateForum ¶
func CreatePost ¶
func CreatePosts ¶ added in v0.1.0
func CreateThread ¶
func CreateTransport ¶ added in v0.2.0
func CreateTransport(url *url.URL) *http_transport.Runtime
func DeltaToHtml ¶ added in v0.2.0
func DeltaToHtml(delta []difflib.DiffRecord) string
func DeltaToText ¶ added in v0.2.0
func DeltaToText(delta []difflib.DiffRecord) string
func GetDelta ¶
func GetDelta(data []byte, expected interface{}, prepare Filter) *[]difflib.DiffRecord
func InvertCase ¶ added in v0.1.0
func Modifications ¶ added in v0.1.0
func ObjectsAreEqual ¶
func ObjectsAreEqual(expected, actual interface{}) bool
func PrettyJson ¶ added in v0.2.0
func RandomEmail ¶
func RandomForum ¶
func RandomMarker ¶ added in v0.1.0
func RandomMarker() string
func RandomNickname ¶
func RandomNickname() string
func RandomPost ¶
func RandomThread ¶
func RandomTime ¶ added in v0.1.0
func RandomUser ¶
func SortPosts ¶ added in v0.1.0
func SortPosts(posts []OrderedPost, desc bool, limitType func(OrderedPost) int, limit int) [][]*models.Post
Types ¶
type Abc ¶ added in v0.2.0
type Abc struct {
// contains filtered or unexported fields
}
Алфавит
func NewAbc ¶ added in v0.2.0
NewAbc constructs a new instance of shuffled alphabet to be used for Id representation.
func (*Abc) Encode ¶ added in v0.2.0
Encode encodes a given value into a slice of runes of length nsymbols. In case nsymbols==0, the length of the result is automatically computed from data. Even if fewer symbols is required to encode the data than nsymbols, all positions are used encoding 0 where required to guarantee uniqueness in case further data is added to the sequence. The value of digits [4,6] represents represents n in 2^n, which defines how much randomness flows into the algorithm: 4 -- every value can be represented by 4 symbols in the alphabet (permitting at most 16 values), 5 -- every value can be represented by 2 symbols in the alphabet (permitting at most 32 values), 6 -- every value is represented by exactly 1 symbol with no randomness (permitting 64 values).
type Checker ¶
type Checker struct { // Имя текущей проверки. Name string // Описание текущей проверки. Description string // Функция для текущей проверки. FnCheck func(c *client.Forum) // Тесты, без которых проверка не имеет смысл. Deps []string }
func SortedChecks ¶ added in v0.2.0
func SortedChecks() []Checker
type CheckerByName ¶ added in v0.2.0
type CheckerByName []Checker
func (CheckerByName) Len ¶ added in v0.2.0
func (a CheckerByName) Len() int
func (CheckerByName) Less ¶ added in v0.2.0
func (a CheckerByName) Less(i, j int) bool
func (CheckerByName) Swap ¶ added in v0.2.0
func (a CheckerByName) Swap(i, j int)
type CheckerTransport ¶
type CheckerTransport struct {
// contains filtered or unexported fields
}
func (*CheckerTransport) Submit ¶
func (self *CheckerTransport) Submit(operation *runtime.ClientOperation) (interface{}, error)
type OrderedPost ¶ added in v0.1.0
type OrderedPost struct {
// contains filtered or unexported fields
}
func CreateTree ¶ added in v0.1.0
func CreateTree(c *client.Forum, thread *models.Thread) []OrderedPost
type PostSortTree ¶ added in v0.1.0
type PostSortTree []OrderedPost
func (PostSortTree) Len ¶ added in v0.1.0
func (a PostSortTree) Len() int
func (PostSortTree) Less ¶ added in v0.1.0
func (a PostSortTree) Less(i, j int) bool
func (PostSortTree) Swap ¶ added in v0.1.0
func (a PostSortTree) Swap(i, j int)
type Report ¶
type Report struct { Checker Checker Pass []ReportPass SkippedBy []string Result ResultType }
func (*Report) Checkpoint ¶
type ReportHttp ¶ added in v0.2.0
func RequestInfo ¶ added in v0.2.0
func RequestInfo(req *http.Request) *ReportHttp
func ResponseInfo ¶ added in v0.2.0
func ResponseInfo(res *http.Response) *ReportHttp
func (*ReportHttp) String ¶ added in v0.2.0
func (self *ReportHttp) String() string
type ReportMessage ¶ added in v0.2.0
type ReportMessage struct { Url string Delta template.HTML Request *ReportHttp Response *ReportHttp Example *ReportHttp }
type ReportPass ¶ added in v0.2.0
type ReportPass struct { Name string Failure string Messages []ReportMessage }
type ResultType ¶ added in v0.2.0
type ResultType int
const ( Failed ResultType = iota Skipped Success )
type Shortid ¶ added in v0.2.0
type Shortid struct {
// contains filtered or unexported fields
}
Идентификатор
func NewShortid ¶ added in v0.2.0
Создание нового генератора
func (*Shortid) Abc ¶ added in v0.2.0
Abc returns the instance of alphabet used for representing the Ids.
func (*Shortid) Epoch ¶ added in v0.2.0
Epoch returns the value of epoch used as the beginning of millisecond counting (normally 2016-01-01 00:00:00 local time)
func (*Shortid) GenerateRandom ¶ added in v0.2.0
Generate generates a new short Id.
type ThreadByCreated ¶ added in v0.1.0
func (ThreadByCreated) Len ¶ added in v0.1.0
func (a ThreadByCreated) Len() int
func (ThreadByCreated) Less ¶ added in v0.1.0
func (a ThreadByCreated) Less(i, j int) bool
func (ThreadByCreated) Swap ¶ added in v0.1.0
func (a ThreadByCreated) Swap(i, j int)
type UserByNickname ¶
func (UserByNickname) Len ¶
func (a UserByNickname) Len() int
func (UserByNickname) Less ¶
func (a UserByNickname) Less(i, j int) bool
func (UserByNickname) Swap ¶
func (a UserByNickname) Swap(i, j int)
Source Files ¶
- check_clear.go
- check_forum_create.go
- check_forum_get_one.go
- check_forum_get_threads.go
- check_forum_get_users.go
- check_post_get_one.go
- check_post_update.go
- check_posts_create.go
- check_status.go
- check_thread_create.go
- check_thread_get_one.go
- check_thread_get_posts.go
- check_thread_update.go
- check_thread_vote.go
- check_user_create.go
- check_user_get_one.go
- check_user_update.go
- checker.go
- common.go
- delta.go
- expected.go
- factory.go
- filler.go
- modify.go
- report.go
- shortid.go