當前位置: 首頁>>代碼示例>>Golang>>正文


Golang UUID.String方法代碼示例

本文整理匯總了Golang中github.com/google/uuid.UUID.String方法的典型用法代碼示例。如果您正苦於以下問題:Golang UUID.String方法的具體用法?Golang UUID.String怎麽用?Golang UUID.String使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/google/uuid.UUID的用法示例。


在下文中一共展示了UUID.String方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: addContextAssociation

func (s *SlackLink) addContextAssociation(context uuid.UUID, channelID string) {
	s.contextChannelsLock.Lock()
	s.contextChannels[context.String()] = channelID
	s.contextChannelsLock.Unlock()
	s.contextBuffersLock.Lock()
	s.contextBuffers[context.String()] = bytes.NewBuffer(nil)
	s.contextBuffersLock.Unlock()
}
開發者ID:FoxelBox,項目名稱:FoxBukkitSlackLink,代碼行數:8,代碼來源:slacklink.go

示例2: removeContextAssociation

func (s *SlackLink) removeContextAssociation(context uuid.UUID) {
	s.contextChannelsLock.Lock()
	delete(s.contextChannels, context.String())
	s.contextChannelsLock.Unlock()
	s.contextBuffersLock.Lock()
	delete(s.contextBuffers, context.String())
	s.contextBuffersLock.Unlock()
	s.removeSpecialAcknowledgementContext(context)
}
開發者ID:FoxelBox,項目名稱:FoxBukkitSlackLink,代碼行數:9,代碼來源:slacklink.go

示例3: getSpecialAcknowledgement

func (s *SlackLink) getSpecialAcknowledgement(context uuid.UUID) (*slack.ItemRef, string, bool) {
	s.specialAcknowledgementContextsLock.Lock()
	defer s.specialAcknowledgementContextsLock.Unlock()
	entry, ok := s.specialAcknowledgementContexts[context.String()]
	if !ok {
		return nil, "", false
	}

	return entry.Ref, entry.MustContain, true
}
開發者ID:FoxelBox,項目名稱:FoxBukkitSlackLink,代碼行數:10,代碼來源:slacklink.go

示例4: getContextBuffer

func (s *SlackLink) getContextBuffer(context uuid.UUID) *bytes.Buffer {
	s.contextBuffersLock.Lock()
	defer s.contextBuffersLock.Unlock()
	buf, ok := s.contextBuffers[context.String()]
	if !ok {
		buf = new(bytes.Buffer)
		s.contextBuffers[context.String()] = buf
	}

	return buf
}
開發者ID:FoxelBox,項目名稱:FoxBukkitSlackLink,代碼行數:11,代碼來源:slacklink.go

示例5: addSpecialAcknowledgementContext

func (s *SlackLink) addSpecialAcknowledgementContext(context uuid.UUID, ref *slack.ItemRef, mustContain string) {
	s.specialAcknowledgementContextsLock.Lock()
	defer s.specialAcknowledgementContextsLock.Unlock()
	s.specialAcknowledgementContexts[context.String()] = struct {
		MustContain string
		Ref         *slack.ItemRef
	}{
		MustContain: mustContain,
		Ref:         ref,
	}
}
開發者ID:FoxelBox,項目名稱:FoxBukkitSlackLink,代碼行數:11,代碼來源:slacklink.go

示例6: getMinecraftPlayer

func (s *SlackLink) getMinecraftPlayer(id uuid.UUID) *MinecraftPlayer {
	name, err := s.redis.HGet("playerUUIDToName", id.String()).Result()
	if err == redis.Nil {
		return &MinecraftPlayer{
			UUID: id,
		}
	} else if err != nil {
		log.Printf("error in getMinecraftPlayer: %v", err)
		return nil
	}

	return &MinecraftPlayer{
		UUID: id,
		Name: name,
	}
}
開發者ID:FoxelBox,項目名稱:FoxBukkitSlackLink,代碼行數:16,代碼來源:link.go

示例7: removeSpecialAcknowledgementContext

func (s *SlackLink) removeSpecialAcknowledgementContext(context uuid.UUID) {
	s.specialAcknowledgementContextsLock.Lock()
	defer s.specialAcknowledgementContextsLock.Unlock()
	delete(s.specialAcknowledgementContexts, context.String())
}
開發者ID:FoxelBox,項目名稱:FoxBukkitSlackLink,代碼行數:5,代碼來源:slacklink.go


注:本文中的github.com/google/uuid.UUID.String方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。