github.com/opentofu/opentofu@v1.7.1/internal/encryption/method/unencrypted/method.go (about)

     1  package unencrypted
     2  
     3  import (
     4  	"github.com/opentofu/opentofu/internal/encryption/method"
     5  )
     6  
     7  func New() method.Descriptor {
     8  	return &descriptor{}
     9  }
    10  
    11  type descriptor struct{}
    12  
    13  func (f *descriptor) ID() method.ID {
    14  	return "unencrypted"
    15  }
    16  func (f *descriptor) ConfigStruct() method.Config {
    17  	return new(config)
    18  }
    19  
    20  type config struct{}
    21  
    22  func (c *config) Build() (method.Method, error) {
    23  	return new(unenc), nil
    24  }
    25  
    26  type unenc struct{}
    27  
    28  func (a *unenc) Encrypt(data []byte) ([]byte, error) {
    29  	panic("Placeholder for type check!  Should never be called!")
    30  }
    31  func (a *unenc) Decrypt(data []byte) ([]byte, error) {
    32  	panic("Placeholder for type check!  Should never be called!")
    33  }
    34  
    35  func Is(m method.Method) bool {
    36  	_, ok := m.(*unenc)
    37  	return ok
    38  }