github.com/rancher/types@v0.0.0-20220328215343-4370ff10ecd5/mapper/drop_from_schema.go (about)

     1  package mapper
     2  
     3  import "github.com/rancher/norman/types/mapper"
     4  
     5  // DropFromSchema This mapper differs from the existing drop mapper in that
     6  // it does not remove the field if it is present, only removing the field from
     7  // the schema. This is so that fields that must be present for formatters and
     8  // stores will be available, but not shown on the schema
     9  type DropFromSchema struct {
    10  	mapper.Drop
    11  }
    12  
    13  func NewDropFromSchema(name string) *DropFromSchema {
    14  	return &DropFromSchema{
    15  		mapper.Drop{
    16  			Field: name,
    17  		},
    18  	}
    19  }
    20  
    21  func (d DropFromSchema) FromInternal(data map[string]interface{}) {
    22  	// Do nothing
    23  }