// GetTagsForToken
322762
func (a memory) GetTagsForToken(token string) ([]string, error) {

	// look for an existing token
	entry, err := a.findMemoryToken(token)
	if err != nil {
		return nil, err
	}

	// convert tags from map to slice
	var tags []string
	for _, tag := range entry.ToSlice() {
		tags = append(tags, tag.(string))
	}

	return tags, nil
}
133672
func (v *BtrfsVolume) GetSnapshotWithTag(tagName string) (*volume.SnapshotInfo, error) {
	// Get all the snapshots on the volume
	snapshotLabels, err := v.Snapshots()
	if err != nil {
		glog.Errorf("Could not get current snapshot list: %s", err)
		return nil, err
	}
	// Get info for each snapshot and return if a matching tag is found
	for _, snapshotLabel := range snapshotLabels {
		if info, err := v.SnapshotInfo(snapshotLabel); err != volume.ErrInvalidSnapshot {
			if err != nil {
				glog.Errorf("Could not get info for snapshot %s: %s", snapshotLabel, err)
				return nil, err
			}
			for _, tag := range info.Tags {
				if tag == tagName {
					return info, nil
				}
			}
		}
	}
	return nil, volume.ErrSnapshotDoesNotExist
}
489611
func (s *IdentityService) GetSignupToken(token string) (*services.SignupToken, error) {
	if token == "" {
		return nil, trace.BadParameter("missing token")
	}
	item, err := s.Get(context.TODO(), backend.Key(userTokensPrefix, token))
	if err != nil {
		return nil, trace.Wrap(err)
	}
	var signupToken services.SignupToken
	err = json.Unmarshal(item.Value, &signupToken)
	if err != nil {
		return nil, trace.Wrap(err)
	}
	return &signupToken, nil
}
1109427
func (r *ReqInfo) GetTags() []KeyVal {
	if r == nil {
		return nil
	}
	r.RLock()
	defer r.RUnlock()
	return append([]KeyVal(nil), r.tags...)
}
656276
func GetFieldTag(obj interface{}, fieldName, tagKey string) (string, error) {
	field, err := getInnerFieldType(obj, fieldName)
	if err != nil {
		return "", err
	}

	if !isExportableField(field) {
		return "", errors.New("Cannot GetFieldTag on a non-exported struct field")
	}

	return field.Tag.Get(tagKey), nil
}
998668
func (th *tagsHandler) GetTags(w http.ResponseWriter, r *http.Request) {
	defer r.Body.Close()

	tagService := th.Repository.Tags(th)
	tags, err := tagService.All(th)
	if err != nil {
		switch err := err.(type) {
		case distribution.ErrRepositoryUnknown:
			th.Errors = append(th.Errors, v2.ErrorCodeNameUnknown.WithDetail(map[string]string{"name": th.Repository.Named().Name()}))
		case errcode.Error:
			th.Errors = append(th.Errors, err)
		default:
			th.Errors = append(th.Errors, errcode.ErrorCodeUnknown.WithDetail(err))
		}
		return
	}

	w.Header().Set("Content-Type", "application/json")

	enc := json.NewEncoder(w)
	if err := enc.Encode(tagsAPIResponse{
		Name: th.Repository.Named().Name(),
		Tags: tags,
	}); err != nil {
		th.Errors = append(th.Errors, errcode.ErrorCodeUnknown.WithDetail(err))
		return
	}
}
244641
func getTagsKinesisFirehose(conn *firehose.Firehose, d *schema.ResourceData, sn string) error {
	tags := make([]*firehose.Tag, 0)
	var exclusiveStartTagKey string
	for {
		req := &firehose.ListTagsForDeliveryStreamInput{
			DeliveryStreamName: aws.String(sn),
		}
		if exclusiveStartTagKey != "" {
			req.ExclusiveStartTagKey = aws.String(exclusiveStartTagKey)
		}

		resp, err := conn.ListTagsForDeliveryStream(req)
		if err != nil {
			return err
		}

		tags = append(tags, resp.Tags...)

		// If HasMoreTags is true in the response, more tags are available.
		// To list the remaining tags, set ExclusiveStartTagKey to the key
		// of the last tag returned and call ListTagsForDeliveryStream again.
		if !aws.BoolValue(resp.HasMoreTags) {
			break
		}
		exclusiveStartTagKey = aws.StringValue(tags[len(tags)-1].Key)
	}

	err := d.Set("tags", tagsToMapKinesisFirehose(tags))
	return err
}
259672
func (r *apiHandler) GetAuthTag() names.Tag {
	if r.entity == nil {
		return nil
	}
	return r.entity.Tag()
}
1027764
func (a *Client) GetNodesIdentifierTags(params *GetNodesIdentifierTagsParams, authInfo runtime.ClientAuthInfoWriter) (*GetNodesIdentifierTagsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetNodesIdentifierTagsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "GetNodesIdentifierTags",
		Method:             "GET",
		PathPattern:        "/nodes/{identifier}/tags",
		ProducesMediaTypes: []string{"application/json", "application/x-gzip"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &GetNodesIdentifierTagsReader{formats: a.formats},
		AuthInfo:           authInfo,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetNodesIdentifierTagsOK), nil
}
843393
func getImageStreamTagSuggestion(g osgraph.Graph, f osgraph.Namer, tagNode *imagegraph.ImageStreamTagNode) osgraph.Suggestion {
	bcs := []string{}
	for _, bcNode := range g.PredecessorNodesByEdgeKind(tagNode, buildedges.BuildOutputEdgeKind) {
		bcs = append(bcs, f.ResourceName(bcNode))
	}
	if len(bcs) == 1 {
		return osgraph.Suggestion(fmt.Sprintf("oc start-build %s", bcs[0]))
	}
	if len(bcs) > 0 {
		return osgraph.Suggestion(fmt.Sprintf("`oc start-build` with one of these: %s.", strings.Join(bcs[:], ",")))
	}
	return osgraph.Suggestion(fmt.Sprintf("%s needs to be imported.", f.ResourceName(tagNode)))
}
1126089
func (db *PublicRecord) GetTag(tag ombutil.Tag) (*ombjson.BltnPage, error) {
	rows, err := db.selectTag.Query(string(tag), db.maxQueryLimit)
	defer rows.Close()
	if err != nil {
		return nil, err
	}

	bltns, err := scanBltns(rows)
	if err != nil {
		return nil, err
	}

	page := &ombjson.BltnPage{
		Bulletins: bltns,
	}

	blk, err := db.GetBlockTip()
	if err != nil {
		return nil, err
	}
	page.Start = blk.Head.Hash

	if len(bltns) < db.maxQueryLimit {
		// This is ugly
		page.Stop = peg.GetStartBlock().Sha().String()
	} else {
		page.Stop = bltns[len(bltns)-1].BlockRef.Hash
	}

	return page, nil
}
69817
func (a *scribble) GetTagsForToken(token string) ([]string, error) {

	// look for existing token
	entry, err := a.findScribbleToken(token)
	if err != nil {
		return nil, err
	}

	// convert tags from map to slice
	var tags []string
	for k := range entry.Tags {
		tags = append(tags, k)
	}

	return tags, nil
}
286460
func (c Client) GetImageStreamTag(ctx context.Context, name string, options *metav1.GetOptions) (*imagev1.ImageStreamTag, error) {
	return c.ImageStreamTags.ImageStreamTags(apirequest.NamespaceValue(ctx)).Get(name, *options)
}
366218
func GetTagFromNamedRef(ref distreference.Named) string {
	var tag string
	switch x := ref.(type) {
	case distreference.Digested:
		tag = x.Digest().String()
	case distreference.NamedTagged:
		tag = x.Tag()
	default:
		tag = "latest"
	}
	return tag
}
940250
func (mvl *MetricsList) GetTagValue(tag string) (value string, e error) {
	if value, ok := mvl.tags[tag]; !ok {
		return value, errors.New("Tag unknown!")
	} else {
		return value, e
	}
}
170017
func getTag(d logrus.Fields, key string) (tag string, ok bool) {
	v, ok := d[key]
	if !ok {
		return "", false
	}
	switch vs := v.(type) {
	case fmt.Stringer:
		return vs.String(), true
	case string:
		return vs, true
	case byte:
		return string(vs), true
	case int:
		return strconv.FormatInt(int64(vs), 10), true
	case int32:
		return strconv.FormatInt(int64(vs), 10), true
	case int64:
		return strconv.FormatInt(vs, 10), true
	case uint:
		return strconv.FormatUint(uint64(vs), 10), true
	case uint32:
		return strconv.FormatUint(uint64(vs), 10), true
	case uint64:
		return strconv.FormatUint(vs, 10), true
	default:
		return "", false
	}
	return "", false
}
747029
func (c *Client) GetToken(tag names.Tag) (string, error) {
	args := params.GetTokenArgs{Args: []params.GetTokenArg{
		{Tag: tag.String()}},
	}
	var results params.StringResults
	err := c.facade.FacadeCall("GetTokens", args, &results)
	if err != nil {
		return "", errors.Trace(err)
	}
	if len(results.Results) != 1 {
		return "", errors.Errorf("expected 1 result, got %d", len(results.Results))
	}
	result := results.Results[0]
	if result.Error != nil {
		if params.IsCodeNotFound(result.Error) {
			return "", errors.NotFoundf("token for %v", tag)
		}
		return "", errors.Trace(result.Error)
	}
	return result.Result, nil
}