Home / File/ binding_test.go — gin Source File

binding_test.go — gin Source File

Architecture documentation for binding_test.go, a go file in the gin codebase. 1 imports, 0 dependents.

File go RequestBinding FormBinding 1 imports 93 functions 8 classes

Entity Profile

Dependency Diagram

graph LR
  314c6481_2bd0_e5a7_282c_94e41df6062a["binding_test.go"]
  fefe783b_8987_7aed_66c9_b2860bfc32e7["bytes"]
  314c6481_2bd0_e5a7_282c_94e41df6062a --> fefe783b_8987_7aed_66c9_b2860bfc32e7
  style 314c6481_2bd0_e5a7_282c_94e41df6062a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.

package binding

import (
	"bytes"
	"encoding/json"
	"errors"
	"io"
	"mime/multipart"
	"net/http"
	"os"
	"reflect"
	"strconv"
	"strings"
	"testing"
	"time"

	"github.com/gin-gonic/gin/testdata/protoexample"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
	"go.mongodb.org/mongo-driver/bson"
	"google.golang.org/protobuf/proto"
)

type appkey struct {
	Appkey string `json:"appkey" form:"appkey"`
}

type QueryTest struct {
	Page int `json:"page" form:"page"`
	Size int `json:"size" form:"size"`
	appkey
}

type FooStruct struct {
	Foo string `msgpack:"foo" json:"foo" form:"foo" xml:"foo" binding:"required,max=32"`
}

type FooBarStruct struct {
	FooStruct
	Bar string `msgpack:"bar" json:"bar" form:"bar" xml:"bar" binding:"required"`
}

type FooBarFileStruct struct {
	FooBarStruct
	File *multipart.FileHeader `form:"file" binding:"required"`
}

type FooBarFileFailStruct struct {
	FooBarStruct
	File *multipart.FileHeader `invalid_name:"file" binding:"required"`
}

type FooDefaultBarStruct struct {
	FooStruct
	Bar string `msgpack:"bar" json:"bar" form:"bar,default=hello" xml:"bar" binding:"required"`
}
// ... (1375 more lines)

Subdomains

Functions

Dependencies

  • bytes

Frequently Asked Questions

What does binding_test.go do?
binding_test.go is a source file in the gin codebase, written in go. It belongs to the RequestBinding domain, FormBinding subdomain.
What functions are defined in binding_test.go?
binding_test.go defines 93 function(s): TestBindingBSON, TestBindingDefault, TestBindingDefaultValueFormPost, TestBindingForm, TestBindingForm2, TestBindingFormDefaultValue, TestBindingFormDefaultValue2, TestBindingFormEmbeddedStruct, TestBindingFormEmbeddedStruct2, TestBindingFormFilesMultipart, and 83 more.
What does binding_test.go depend on?
binding_test.go imports 1 module(s): bytes.
Where is binding_test.go in the architecture?
binding_test.go is located at binding/binding_test.go (domain: RequestBinding, subdomain: FormBinding, directory: binding).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free