// Object implements config.Accessor
428260
func (s *podStorage) MergedState() interface{} {
	s.podLock.RLock()
	defer s.podLock.RUnlock()
	pods := make([]*v1.Pod, 0)
	for _, sourcePods := range s.pods {
		for _, podRef := range sourcePods {
			pods = append(pods, podRef.DeepCopy())
		}
	}
	return pods
}
81189
func (a *poller) configuration() (runtime.Object, error) {
	a.once.Do(a.bootstrapping)
	a.lock.RLock()
	defer a.lock.RUnlock()
	retries := 1
	if !a.bootstrapped {
		retries = a.bootstrapRetries
	}
	for count := 0; count < retries; count++ {
		if count > 0 {
			a.lock.RUnlock()
			time.Sleep(a.interval)
			a.lock.RLock()
		}
		if a.ready {
			return a.mergedConfiguration, nil
		}
	}
	if a.lastErr != nil {
		return nil, a.lastErr
	}
	return nil, ErrNotReady
}
861705
func (d config) Version() string {
	st := structs.New(d.data)
	f := st.Field("Version")
	return f.Value().(string)
}
30823
func (c Core) CopyObject(sourceBucket, sourceObject, destBucket, destObject string, metadata map[string]string) (ObjectInfo, error) {
	return c.copyObjectDo(context.Background(), sourceBucket, sourceObject, destBucket, destObject, metadata)
}
1259117
func (t *Transporter) Config(call goja.FunctionCall) goja.Value {
	if cfg, ok := call.Argument(0).Export().(map[string]interface{}); ok {
		b, err := json.Marshal(cfg)
		if err != nil {
			panic(err)
		}

		var c config
		if err = json.Unmarshal(b, &c); err != nil {
			panic(err)
		}
		t.config = &c
	}
	return t.vm.ToValue(t)
}
338138
func (s *OAuthService) Access(clientID string, clientSecret string, code string) *OAuthAccessCall {
	var call OAuthAccessCall
	call.service = s
	call.clientID = clientID
	call.clientSecret = clientSecret
	call.code = code
	return &call
}
985594
func (v *Object) GetObject(keys ...string) (*Object, error) {
	child, err := v.getPath(keys)

	if err != nil {
		return nil, err
	} else {

		obj, err := child.Object()

		if err != nil {
			return nil, err
		} else {
			return obj, nil
		}

	}
}
3879
func (value Value) Object() *Object {
	switch object := value.value.(type) {
	case *_object:
		return _newObject(object, value)
	}
	return nil
}
890627
func (c *Config) Config() *Config {
	// Guard against nil pointer dereference
	if c == nil {
		return NewConfig()
	}

	// Return a clone of the config so that this is immutable for the receiver
	c2 := *c
	return &c2
}
793396
func loadConfig(objAPI ObjectLayer) error {
	srvCfg, err := getValidConfig(objAPI)
	if err != nil {
		return uiErrInvalidConfig(nil).Msg(err.Error())
	}

	// Override any values from ENVs.
	srvCfg.loadFromEnvs()

	// Load values to cached global values.
	srvCfg.loadToCachedConfigs()

	// hold the mutex lock before a new config is assigned.
	globalServerConfigMu.Lock()
	globalServerConfig = srvCfg
	globalServerConfigMu.Unlock()

	return nil
}
321102
func (v *Value) Object() (*Object, error) {

	var valid bool

	// Check the type of this data
	switch v.data.(type) {
	case map[string]interface{}:
		valid = true
		break
	}

	if valid {
		obj := new(Object)
		obj.valid = valid

		m := make(map[string]*Value)

		if valid {
			for key, element := range v.data.(map[string]interface{}) {
				m[key] = &Value{element, true}

			}
		}

		obj.data = v.data
		obj.m = m

		return obj, nil
	}

	return nil, ErrNotObject
}
61756
func (k *Item) SetAccess(a *Access) {
	if a != nil {
		k.attr[AccessKey] = a
	} else {
		delete(k.attr, AccessKey)
	}
}
757833
func main() {
	conf, err := GetConfig()
	if err != nil {
		log.Printf("Error getting config [%s]", err)
		os.Exit(1)
	}

	router := mux.NewRouter()

	var database db.DB
	switch conf.DBType {
	case "mem":
		database = db.NewMem()
	case "redis":
		redisOpts := &redis.Options{
			Addr:     fmt.Sprintf(conf.RedisHost),
			Password: conf.RedisPass,
			DB:       conf.RedisDB,
		}
		rawRedisClient := redis.NewClient(redisOpts)
		database = db.NewRedis(rawRedisClient)
	default:
		log.Printf("Error: no available DB type %s", conf.DBType)
		os.Exit(1)
	}

	cah := handlers.NewCreateAppHandler(database)
	cah.RegisterRoute(router)

	gah := handlers.NewGetAppHandler(database)
	gah.RegisterRoute(router)

	dah := handlers.NewDeleteAppHandler(database)
	dah.RegisterRoute(router)

	portStr := fmt.Sprintf(":%d", conf.Port)
	log.Printf("Serving on %s", portStr)
	log.Fatal(http.ListenAndServe(portStr, router))
}
737221
func AccessHandler(f func(r *http.Request, status, size int, duration time.Duration)) func(next http.Handler) http.Handler {
	return func(next http.Handler) http.Handler {
		return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
			start := time.Now()
			lw := mutil.WrapWriter(w)
			next.ServeHTTP(lw, r)
			f(r, lw.Status(), lw.BytesWritten(), time.Since(start))
		})
	}
}
823732
func (g *Container) Object(path ...string) (*Container, error) {
	return g.Set(map[string]interface{}{}, path...)
}
459158
func (r *ErrorReporter) AsObject(err error) runtime.Object {
	status := NewGenericServerResponse(r.code, r.verb, schema.GroupResource{}, "", err.Error(), 0, true)
	if status.ErrStatus.Details == nil {
		status.ErrStatus.Details = &metav1.StatusDetails{}
	}
	reason := r.reason
	if len(reason) == 0 {
		reason = "ClientError"
	}
	status.ErrStatus.Details.Causes = append(status.ErrStatus.Details.Causes, metav1.StatusCause{
		Type:    metav1.CauseType(reason),
		Message: err.Error(),
	})
	return &status.ErrStatus
}
679567
func (g *GcsFS) Objects(ctx context.Context, csq cloudstorage.Query) (cloudstorage.ObjectIterator, error) {
	var q = &storage.Query{Prefix: csq.Prefix}
	iter := g.gcsb().Objects(ctx, q)
	return &objectIterator{g, ctx, iter}, nil
}