gitlab.com/evatix-go/core@v1.3.55/coreinstruction/BaseIsSecure.go (about)

     1  package coreinstruction
     2  
     3  type BaseIsSecure struct {
     4  	IsSecure bool // indicates secure text, invert means log payload, plain text. it will not log payload
     5  }
     6  
     7  func NewSecure() BaseIsSecure {
     8  	return BaseIsSecure{
     9  		IsSecure: true,
    10  	}
    11  }
    12  
    13  func NewPlain() BaseIsSecure {
    14  	return BaseIsSecure{
    15  		IsSecure: false,
    16  	}
    17  }
    18  
    19  func (it *BaseIsSecure) IsPlainText() bool {
    20  	return it == nil || !it.IsSecure
    21  }
    22  
    23  func (it *BaseIsSecure) IsIncludePayload() bool {
    24  	return it == nil || !it.IsSecure
    25  }