Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 56 for _new (0.03 sec)

  1. internal/cachevalue/cache.go

    	// Managed values.
    	val          atomic.Pointer[T]
    	lastUpdateMs atomic.Int64
    	updating     sync.Mutex
    }
    
    // New allocates a new cached value instance. Tt must be initialized with
    // `.TnitOnce`.
    func New[T any]() *Cache[T] {
    	return &Cache[T]{}
    }
    
    // NewFromFunc allocates a new cached value instance and initializes it with an
    // update function, making it ready for use.
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 12:50:46 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  2. internal/event/target/webhook.go

    	if !w.Enable {
    		return nil
    	}
    	if w.Endpoint.IsEmpty() {
    		return errors.New("endpoint empty")
    	}
    	if w.QueueDir != "" {
    		if !filepath.IsAbs(w.QueueDir) {
    			return errors.New("queueDir path should be absolute")
    		}
    	}
    	if w.ClientCert != "" && w.ClientKey == "" || w.ClientCert == "" && w.ClientKey != "" {
    		return errors.New("cert and key must be specified as a pair")
    	}
    	return nil
    }
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 8.5K bytes
    - Viewed (0)
  3. internal/config/identity/openid/jwks.go

    	D   string `json:"d,omitempty"`
    	N   string `json:"n,omitempty"`
    	E   string `json:"e,omitempty"`
    	K   string `json:"k,omitempty"`
    }
    
    var (
    	errMalformedJWKRSAKey = errors.New("malformed JWK RSA key")
    	errMalformedJWKECKey  = errors.New("malformed JWK EC key")
    )
    
    // DecodePublicKey - decodes JSON Web Key (JWK) as public key
    func (key *JWKS) DecodePublicKey() (crypto.PublicKey, error) {
    	switch key.Kty {
    	case "RSA":
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue Apr 02 23:02:35 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  4. internal/logger/targets.go

    		key := strings.ToLower(t.Type().String())
    		n := cnt[key]
    		cnt[key]++
    		key = fmt.Sprintf("audit_%s_%d", key, n)
    		res[key] = t.Stats()
    	}
    
    	return res
    }
    
    // AddSystemTarget adds a new logger target to the
    // list of enabled loggers
    func AddSystemTarget(ctx context.Context, t Target) error {
    	if err := t.Init(ctx); err != nil {
    		return err
    	}
    
    	if consoleTgt == nil {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Mon Jun 03 15:44:50 UTC 2024
    - 6K bytes
    - Viewed (0)
  5. internal/crypto/sse-s3.go

    	if keyID == "" && len(kmsKey) != 0 {
    		logger.CriticalIf(context.Background(), errors.New("The key ID must not be empty if a KMS data key is present"))
    	}
    	if keyID != "" && len(kmsKey) == 0 {
    		logger.CriticalIf(context.Background(), errors.New("The KMS data key must not be empty if a key ID is present"))
    	}
    
    	if metadata == nil {
    		metadata = make(map[string]string, 5)
    	}
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue May 07 23:55:37 UTC 2024
    - 7.6K bytes
    - Viewed (0)
  6. cmd/callhome.go

    // initCallhome will start the callhome task in the background.
    func initCallhome(ctx context.Context, objAPI ObjectLayer) {
    	if !globalCallhomeConfig.Enabled() {
    		return
    	}
    
    	go func() {
    		r := rand.New(rand.NewSource(time.Now().UnixNano()))
    		// Leader node (that successfully acquires the lock inside runCallhome)
    		// will keep performing the callhome. If the leader goes down for some reason,
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 17 16:53:34 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  7. internal/grid/grid.go

    	// Used if no deadline is provided on context.
    	defaultSingleRequestTimeout = time.Minute
    )
    
    var internalByteBuffer = sync.Pool{
    	New: func() any {
    		m := make([]byte, 0, defaultBufferSize)
    		return &m
    	},
    }
    
    var internal32KByteBuffer = sync.Pool{
    	New: func() any {
    		m := make([]byte, 0, biggerBufMin)
    		return &m
    	},
    }
    
    // GetByteBuffer can be replaced with a function that returns a small
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue Apr 02 15:56:18 UTC 2024
    - 4.8K bytes
    - Viewed (0)
  8. internal/config/policy/opa/config.go

    		AuthToken:   authToken,
    		Transport:   transport,
    		CloseRespFn: closeRespFn,
    	}
    	if err = args.Validate(); err != nil {
    		return args, err
    	}
    	return args, nil
    }
    
    // New - initializes opa policy engine connector.
    func New(args Args) *Opa {
    	// No opa args.
    	if args.URL == nil || args.URL.Scheme == "" && args.AuthToken == "" {
    		return nil
    	}
    	return &Opa{
    		args:   args,
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  9. cmd/kms-handlers.go

    // KMSCreateKeyHandler - POST /minio/kms/v1/key/create?key-id=<master-key-id>
    func (a kmsAPIHandlers) KMSCreateKeyHandler(w http.ResponseWriter, r *http.Request) {
    	// If env variable MINIO_KMS_SECRET_KEY is populated, prevent creation of new keys
    	ctx := newContext(r, w, "KMSCreateKey")
    	defer logger.AuditLog(ctx, w, r, mustGetClaimsFromToken(r))
    
    	objectAPI, _ := validateAdminReq(ctx, w, r, policy.KMSCreateKeyAction)
    	if objectAPI == nil {
    		return
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 8.2K bytes
    - Viewed (0)
  10. cmd/net_test.go

    		})
    	}
    }
    
    func TestExtractHostPort(t *testing.T) {
    	testCases := []struct {
    		addr        string
    		host        string
    		port        string
    		expectedErr error
    	}{
    		{"", "", "", errors.New("unable to process empty address")},
    		{"localhost:9000", "localhost", "9000", nil},
    		{"http://:9000/", "", "9000", nil},
    		{"http://8.8.8.8:9000/", "8.8.8.8", "9000", nil},
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Apr 19 08:43:09 UTC 2024
    - 9.3K bytes
    - Viewed (0)
Back to top