func (g *Generator) SetInfo(title, description, term, version string) *Generator {
	info := InfoObj{
		Title:          title,
		Description:    description,
		TermsOfService: term,
		Version:        version,
	}
	g.mu.Lock()
	g.doc.Info = info
	g.mu.Unlock()
	return g
}
SetInfo set information about API
package swgen
import (
	"encoding/json"
	"net/http"
	"reflect"
	"strings"
	"sync"
)
type Generator struct {
	doc  Document
	host string  
	corsMu           sync.RWMutex  
	corsEnabled      bool          
	corsAllowHeaders []string
	definitionAdded map[string]bool            
	definitions     defMap                     
	defQueue        map[reflect.Type]struct{}  
	paths           map[string]PathItem        
	typesMap        map[reflect.Type]interface{}
	indentJSON     bool
	reflectGoTypes bool
	mu sync.Mutex  
}
type defMap map[reflect.Type]SchemaObj
func (m *defMap) GenDefinitions() (result map[string]SchemaObj) {
	if m == nil {
		return nil
	}
	result = make(map[string]SchemaObj)
	for t, typeDef := range *m {
		typeDef.Ref = ""  
		if _, ok := result[typeDef.TypeName]; ok {
			typeName := goType(t)
			result[typeName] = typeDef
		} else {
			result[typeDef.TypeName] = typeDef
		}
	}
	return
}
func NewGenerator() *Generator {
	g := &Generator{}
	g.definitions = make(map[reflect.Type]SchemaObj)
	g.definitionAdded = make(map[string]bool)
	g.defQueue = make(map[reflect.Type]struct{})
	g.paths = make(map[string]PathItem)  
	g.typesMap = make(map[reflect.Type]interface{})
	g.doc.Schemes = []string{"http", "https"}
	g.doc.Paths = make(map[string]PathItem)
	g.doc.Definitions = make(map[string]SchemaObj)
	g.doc.SecurityDefinitions = make(map[string]SecurityDef)
	g.doc.Version = "2.0"
	g.doc.BasePath = "/"
	g.corsAllowHeaders = []string{"Content-Type", "api_key", "Authorization"}
	return g
}
func (g *Generator) IndentJSON(enabled bool) *Generator {
	g.mu.Lock()
	g.indentJSON = enabled
	g.mu.Unlock()
	return g
}
func (g *Generator) ReflectGoTypes(enabled bool) *Generator {
	g.mu.Lock()
	g.reflectGoTypes = enabled
	g.mu.Unlock()
	return g
}
func (g *Generator) EnableCORS(b bool, allowHeaders ...string) *Generator {
	g.corsMu.Lock()
	g.corsEnabled = b
	if len(allowHeaders) != 0 {
		g.corsAllowHeaders = append(g.corsAllowHeaders, allowHeaders...)
	}
	g.corsMu.Unlock()
	return g
}
func (g *Generator) writeCORSHeaders(w http.ResponseWriter) {
	g.corsMu.RLock()
	defer g.corsMu.RUnlock()
	if !g.corsEnabled {
		return
	}
	w.Header().Set("Access-Control-Allow-Origin", "*")
	w.Header().Set("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT, PATCH, OPTIONS")
	w.Header().Set("Access-Control-Allow-Headers", strings.Join(g.corsAllowHeaders, ", "))
}
func (g *Generator) SetHost(host string) *Generator {
	g.mu.Lock()
	g.host = host
	g.mu.Unlock()
	return g
}
func (g *Generator) SetBasePath(basePath string) *Generator {
	basePath = "/" + strings.Trim(basePath, "/")
	g.mu.Lock()
	g.doc.BasePath = basePath
	g.mu.Unlock()
	return g
}
func (g *Generator) SetContact(name, url, email string) *Generator {
	ct := ContactObj{
		Name:  name,
		URL:   url,
		Email: email,
	}
	g.mu.Lock()
	g.doc.Info.Contact = ct
	g.mu.Unlock()
	return g
}