// MarshalDatabaseServer marshals the database server resource.
MarshalDatabaseServer marshals the database server resource.
// MarshalDatabaseServer marshals the database server resource .
func MarshalDatabaseServer(s DatabaseServer, opts ...MarshalOption) ([]byte, error) {
	if err := s.CheckAndSetDefaults(); err != nil {
		return nil, trace.Wrap(err)
	}
	cfg, err := CollectOptions(opts)
	if err != nil {
		return nil, trace.Wrap(err)
	}
	server := s
	if !cfg.PreserveResourceID {
		server = s.Copy()
		server.SetResourceID(0)
	}
	return utils.FastMarshal(server)
}
func MarshalDatabaseServer ( s DatabaseServer , opts ... MarshalOption ) ( [ ] byte , error ) { if err := s . CheckAndSetDefaults ( ) ; err != nil { return nil , trace . Wrap ( err ) } cfg , err := CollectOptions ( opts ) if err != nil { return nil , trace . Wrap ( err ) } server := s if ! cfg . PreserveResourceID { server = s . Copy ( ) server . SetResourceID ( 0 ) } return utils . FastMarshal ( server ) }
MarshalDatabaseServer marshals the database server resource.
MarshalDatabaseServer marshals the database server resource .
// Avoid modifying the original object to prevent unexpected // data races.