Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for NewJSONPool (0.05 sec)

  1. cmd/peer-rest-server.go

    	madminBgHealState      = grid.NewJSONPool[madmin.BgHealState]()
    	madminCPUs             = grid.NewJSONPool[madmin.CPUs]()
    	madminMemInfo          = grid.NewJSONPool[madmin.MemInfo]()
    	madminNetInfo          = grid.NewJSONPool[madmin.NetInfo]()
    	madminOSInfo           = grid.NewJSONPool[madmin.OSInfo]()
    	madminPartitions       = grid.NewJSONPool[madmin.Partitions]()
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri Oct 04 11:32:32 UTC 2024
    - 53.2K bytes
    - Viewed (0)
  2. internal/grid/types.go

    			}
    		}
    	}
    	return
    }
    
    // JSONPool is a pool for JSON objects that unmarshal into T.
    type JSONPool[T any] struct {
    	pool    sync.Pool
    	emptySz int
    }
    
    // NewJSONPool returns a new JSONPool.
    func NewJSONPool[T any]() *JSONPool[T] {
    	var t T
    	sz := 128
    	if b, err := json.Marshal(t); err != nil {
    		sz = len(b)
    	}
    	return &JSONPool[T]{
    		pool: sync.Pool{
    			New: func() interface{} {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Wed Aug 14 17:11:51 UTC 2024
    - 15.5K bytes
    - Viewed (0)
Back to top