//NewSimpleCookieMapper creates an instance of CookieMapper with the given application name.
964691
func NewSimpleCookieMapper(appName string) CookieMapper {
	result := &SimpleCookieMapper{
		cook: fmt.Sprintf(SESSION_COOKIE, appName),
	}
	return result
}
1078061
func NewSimpleDB(region Region, key aws.AccessKey) (db SimpleDB, err error) {
	// Open an appropriate HTTP connection.
	endpoint := &url.URL{
		Scheme: "https",
		Host:   string(region),
	}

	httpConn, err := conn.NewHttpConn(endpoint)
	if err != nil {
		err = fmt.Errorf("Opening HTTP connection: %v", err)
		return
	}

	// Create a request signer.
	signer, err := conn.NewSigner(key, endpoint.Host)
	if err != nil {
		err = fmt.Errorf("Creating signer: %v", err)
		return
	}

	// Create a connection to the server.
	c, err := conn.NewConn(key, httpConn, signer, time.RealClock())
	if err != nil {
		err = fmt.Errorf("Creating connection: %v", err)
		return
	}

	return newSimpleDB(c)
}
1018231
func NewScope(tagname string) app.Scope {
	ds := &DataScope{
		Data: make(map[string]interface{}),
	}
	return &Scope{
		EventScope: NewEventScope(),
		DataScope:  app.DataScope(ds),
		Injector:   ds.Injector(tagname),
	}
}
1241637
func (api *PublicWhisperAPI) NewSymKey(ctx context.Context) (string, error) {
	return api.w.GenerateSymKey()
}
5777
func NewSimpleTask() *SimpleTask {
	return &SimpleTask{
		ch: make(chan *Update),
		wg: new(sync.WaitGroup),
	}
}
921774
func NewSetCookieArgs(name string, value string) *SetCookieArgs {
	args := new(SetCookieArgs)
	args.Name = name
	args.Value = value
	return args
}
846019
func NewDeleteCookiesArgs(name string) *DeleteCookiesArgs {
	args := new(DeleteCookiesArgs)
	args.Name = name
	return args
}
652670
func NewSetCookiesArgs(cookies []CookieParam) *SetCookiesArgs {
	args := new(SetCookiesArgs)
	args.Cookies = cookies
	return args
}
1287448
func (m *Module) newSessionCookie(u *UserSession) (*http.Cookie, error) {
	return m.newScopedSessionCookie(u, m.CookieDomain)
}
766961
func NewSimpleBlock(e *edtd.Elem) (*SimpleBlock, error) {
	data, err := e.Bytes()
	if err != nil {
		return nil, err
	}
	
	return parseAsSimpleBlock(data)
}
141798
func GetCookie(ctx context.Context, name string) string {
	c, err := ctx.Request().Cookie(name)
	if err != nil {
		return ""
	}

	return c.Value
}
1128471
func NewSimplePBundle(r *http.Request, s Session, mgr SessionManager) (PBundle, error) {
	if err := r.ParseForm(); err != nil {
		return nil, err
	}

	return &simplePBundle{
		h:      ToSimpleMap(r.Header),
		q:      ToSimpleMap(map[string][]string(r.Form)),
		s:      s,
		mgr:    mgr,
		out:    make(map[string]string),
		parent: make(map[reflect.Type]interface{}),
	}, nil
}
550153
func (f *factory) NewSkipHook(hookInfo hook.Info) (Operation, error) {
	hookOp, err := f.NewRunHook(hookInfo)
	if err != nil {
		return nil, err
	}
	return &skipOperation{hookOp}, nil
}
796186
func NewServer(config *service.Config) *ServerImpl {
	logger := logflags.RPCLogger()
	if config.APIVersion < 2 {
		logger.Info("Using API v1")
	}
	if config.Foreground {
		// Print listener address
		logflags.WriteAPIListeningMessage(config.Listener.Addr().String())
	}
	return &ServerImpl{
		config:   config,
		listener: config.Listener,
		stopChan: make(chan struct{}),
		log:      logger,
	}
}
511256
func ValidCookieName(name []byte) bool {
	for _, c := range name {
		if !OctetTypes[c].IsToken() {
			return false
		}
	}
	return true
}
1245819
func NewSimpleClient(hosts []string) (*simpleEtcdClient, error) {
	cfg := client.Config{
		Endpoints: hosts,
	}

	r, err := client.New(cfg)
	if err != nil {
		return nil, err
	}

	return &simpleEtcdClient{
		realClient: r,
	}, nil
}
1356343
func NewMapper(opt Option) *Mapper {
	if opt.NameFunc == nil {
		opt.NameFunc = ToUpperCamelCase
	}
	if opt.TagName == "" {
		opt.TagName = "gluamapper"
	}
	return &Mapper{opt}
}