// Get gets the token and checks it's TTL
352069
func (s *memoryStore) Get(parent, scope string) (string, error) {
	key := s.key(parent, scope)
	tok, ok := s.tokens[key]

	// token not set
	if !ok {
		return "", nil
	}

	// token set but expired, remove it from the map
	if time.Now().After(tok.Deadline) {
		delete(s.tokens, key)
		return "", nil
	}

	return tok.Token, nil
}
656438
func (i Int64) Get() (int64, error) {
	if !i.Present() {
		var zero int64
		return zero, errors.New("value not present")
	}
	return *i.value, nil
}
62656
func GetToken(c *gin.Context) string {
	token, exists := c.Get("JWT_TOKEN")
	if !exists {
		return ""
	}

	return token.(string)
}
601463
func (s *orgController) Get() interface{} {
	var handler OrgGetHandler = func(params martini.Params, log *log.Logger, r render.Render, tokens oauth2.Tokens) {
		username := params[UserParam]
		org := NewOrg(username, log, tokens, s.store(), s.authClient)
		result, err := org.Show()
		genericResponseFormatter(r, "", structs.Map(result), err)
	}
	return handler
}
121357
func (i *InternalTokenHelper) Get() (string, error) {
	i.populateTokenPath()
	f, err := os.Open(i.tokenPath)
	if os.IsNotExist(err) {
		return "", nil
	}
	if err != nil {
		return "", err
	}
	defer f.Close()

	buf := bytes.NewBuffer(nil)
	if _, err := io.Copy(buf, f); err != nil {
		return "", err
	}

	return strings.TrimSpace(buf.String()), nil
}
744930
func (s *Safe) Get() interface{} {
	s.lock.RLock()
	defer s.lock.RUnlock()
	return s.value
}
1169983
func (blink *blink) Get(keys ...Key) Keys {
	found := make(Keys, 0, len(keys))
	for _, k := range keys {
		found = append(found, blink.get(k))
	}

	return found
}
1316062
func (c *TransactionContexts) Get(chainID, txID string) *TransactionContext {
	ctxID := contextID(chainID, txID)
	c.mutex.Lock()
	tc := c.contexts[ctxID]
	c.mutex.Unlock()
	return tc
}
524335
func (c Claims) Get(key string) interface{} {
	if c == nil {
		return nil
	}
	return c[key]
}
653844
func (u Uint64) Get() (uint64, error) {
	if !u.Present() {
		var zero uint64
		return zero, errors.New("value not present")
	}
	return *u.value, nil
}
772115
func (c *Client) Get() *bytes.Buffer {
	b := <-c.p.ch
	b.Reset()
	c.sent <- b
	return b
}
189096
func (m *MutexKV) get(key string) *sync.Mutex {
	m.lock.Lock()
	defer m.lock.Unlock()
	mutex, ok := m.store[key]
	if !ok {
		mutex = &sync.Mutex{}
		m.store[key] = mutex
	}
	return mutex
}
494152
func (s *Duration) Get() time.Duration {
	return time.Duration(atomic.LoadInt64(&s.currentVal))
}
377373
func (a *API) GetToken(token int) (*Token, error) {
	dst := new(Token)
	url := a.BuildURL("/v2/agent/token/%d", token)
	err := a.Get(url, Params{}, dst)
	return dst, err
}
206604
func (e *Error) Get() error {
	e.lock.RLock()
	defer e.lock.RUnlock()

	return e.err
}
1167240
func (s String) Get() (string, error) {
	if !s.Present() {
		var zero string
		return zero, errors.New("value not present")
	}
	return *s.value, nil
}
189381
func (ar *AsyncResult) Get(timeout time.Duration) (interface{}, error) {
	ticker := time.NewTicker(50 * time.Millisecond)
	timeoutChan := time.After(timeout)
	for {
		select {
		case <-timeoutChan:
			err := fmt.Errorf("%v timeout getting result for %s", timeout, ar.TaskID)
			return nil, err
		case <-ticker.C:
			val, err := ar.AsyncGet()
			if err != nil {
				continue
			}
			return val, nil
		}
	}
}