github.com/juju/juju@v0.0.0-20240430160146-1752b71fcf00/apiserver/facades/client/annotations/state.go (about)

     1  // Copyright 2015 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package annotations
     5  
     6  import (
     7  	"github.com/juju/names/v5"
     8  
     9  	"github.com/juju/juju/state"
    10  )
    11  
    12  type annotationAccess interface {
    13  	ModelTag() names.ModelTag
    14  	FindEntity(tag names.Tag) (state.Entity, error)
    15  	Annotations(entity state.GlobalEntity) (map[string]string, error)
    16  	SetAnnotations(entity state.GlobalEntity, annotations map[string]string) error
    17  }
    18  
    19  // TODO - CAAS(externalreality): After all relevant methods are moved from
    20  // state.State to state.Model this stateShim will likely embed only state.Model
    21  // and will be renamed.
    22  type stateShim struct {
    23  	// TODO(menn0) - once FindEntity goes to Model, the embedded State
    24  	// can go from here. The ModelTag method below can also go.
    25  	*state.State
    26  	*state.Model
    27  }
    28  
    29  func (s stateShim) ModelTag() names.ModelTag {
    30  	return s.Model.ModelTag()
    31  }