github.com/juju/juju@v0.0.0-20240430160146-1752b71fcf00/apiserver/authentication/entity.go (about)

     1  // Copyright 2023 Canonical Ltd. All rights reserved.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package authentication
     5  
     6  import (
     7  	"github.com/juju/names/v5"
     8  )
     9  
    10  // TagWrapper is a utility struct to take a names tag and wrap it as to conform
    11  // to the entity interface set out in this packages interfaces.
    12  type tagWrapper struct {
    13  	tag names.Tag
    14  }
    15  
    16  // Tag implements Entity Tag.
    17  func (t *tagWrapper) Tag() names.Tag {
    18  	return t.tag
    19  }
    20  
    21  // TagToEntity takes a name names.Tag and concerts it an authentication Entity.
    22  func TagToEntity(t names.Tag) Entity {
    23  	return &tagWrapper{t}
    24  }