Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for NewBytesWithCopyOf (0.18 sec)

  1. internal/grid/types.go

    // When returned as response, the handler also gives up ownership of the byte slice.
    func NewBytesWith(b []byte) *Bytes {
    	bb := Bytes(b)
    	return &bb
    }
    
    // NewBytesWithCopyOf returns a new byte slice with a copy of the provided content.
    func NewBytesWithCopyOf(b []byte) *Bytes {
    	if b == nil {
    		bb := Bytes(nil)
    		return &bb
    	}
    	bb := NewBytesCap(len(b))
    	*bb = append(*bb, b...)
    	return bb
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Apr 01 23:42:09 GMT 2024
    - 15.4K bytes
    - Viewed (0)
  2. cmd/peer-rest-server.go

    		case ev := <-ch:
    			buf.Reset()
    			tmpEvt.Records[0] = ev
    			if err := enc.Encode(tmpEvt); err != nil {
    				peersLogOnceIf(ctx, err, "event: Encode failed")
    				continue
    			}
    			out <- grid.NewBytesWithCopyOf(buf.Bytes())
    		}
    	}
    }
    
    // TraceHandler sends http trace messages back to peer rest client
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 51.8K bytes
    - Viewed (0)
Back to top