conf

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2022 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config = &struct {
	//ResourcesDir      string              `json:"ResourcesDir"`      //
	//ResourcesDirName  string              `json:"ResourcesDirName"`  //
	//UploadDirName     string              `json:"UploadDirName"`     //
	//HttpPort          string              `json:"HttpPort"`          //
	//HttpsPort         string              `json:"HttpsPort"`         //
	//LogDir       string `json:"LogDir"`       //
	//TLSCertFile       string              `json:"TLSCertFile"`       //
	//TLSKeyFile        string              `json:"TLSKeyFile"`        //
	//DBUrl             string              `json:"DBUrl"`             //
	//LogServer      string `json:"LogServer"`      //
	//Domain            string              `json:"Domain"`            //
	ViewDir     string `json:"ViewDir"`     //
	UploadDir   string `json:"UploadDir"`   //
	DefaultPage string `json:"DefaultPage"` //
	//JsonDataPath      string              `json:"JsonDataPath"`      //
	Debug             bool                `json:"Debug"`             //
	ViewSuffix        string              `json:"ViewSuffix"`        //动态模板,默认文件类型
	ViewActionMapping []ViewActionMapping `json:"ViewActionMapping"` //可以进行映射的文件类型
	Name              string              `json:"Name"`              //
	Ver               string              `json:"Ver"`               //
	SessionExpires    int                 `json:"SessionExpires"`    //
	SecureKey         string              `json:"SecureKey"`         //

}{
	ViewDir:     "view",
	UploadDir:   "upload",
	DefaultPage: "index",

	ViewSuffix:     ".html",
	Name:           "gweb",
	Ver:            "1.3",
	SessionExpires: 1800,
}
View Source
var JsonData = &JsonDataEntity{}

Functions

func LoadData added in v1.2.20

func LoadData(target interface{}) error

Types

type JsonDataEntity added in v1.2.20

type JsonDataEntity struct {
	Type   reflect.Type
	GobBuf []byte
	sync.RWMutex
}

func (*JsonDataEntity) Copy added in v1.2.20

func (j *JsonDataEntity) Copy() interface{}
func (j *JsonDataEntity) New(jsonData []byte) error {
	defer j.Unlock()
	j.Lock()

	j.jsonData = jsonData
	err := json.Unmarshal(jsonData, &j.m)
	if err != nil {
		return err
	}

	return nil
}
func (j *JsonDataEntity) Parse(v interface{}) {
	json.Unmarshal(j.jsonData, v)
}
func (j *JsonDataEntity) Stringify() string {
	return string(j.jsonData)
}

type ViewActionMapping

type ViewActionMapping struct {
	ContentType string `json:"ContentType"`
	Extension   string `json:"Extension"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL