github.com/mre-fog/trillianxx@v1.1.2-0.20180615153820-ae375a99d36a/extension/registry.go (about)

     1  // Copyright 2016 Google Inc. All Rights Reserved.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  // Package extension provides an extension mechanism for Trillian code to access
    16  // fork-specific functionality.
    17  package extension
    18  
    19  import (
    20  	"github.com/google/trillian/crypto/keys"
    21  	"github.com/google/trillian/monitoring"
    22  	"github.com/google/trillian/quota"
    23  	"github.com/google/trillian/storage"
    24  	"github.com/google/trillian/util/election"
    25  )
    26  
    27  // Registry defines all extension points available in Trillian.
    28  // Customizations may easily swap the underlying storage systems by providing their own
    29  // implementation.
    30  type Registry struct {
    31  	// AdminStorage is the storage implementation to use for persisting tree metadata.
    32  	storage.AdminStorage
    33  	// LogStorage is the storage implementation to use for persisting logs.
    34  	storage.LogStorage
    35  	// MapStorage is the storage implementation to use for persisting maps.
    36  	storage.MapStorage
    37  	// ElectionFactory provides MasterElection instances for each tree.
    38  	ElectionFactory election.Factory
    39  	// QuotaManager provides rate limiting capabilities for Trillian.
    40  	QuotaManager quota.Manager
    41  	// MetricFactory provides metrics for monitoring.
    42  	monitoring.MetricFactory
    43  	// NewKeyProto creates a new private key based on a key specification.
    44  	// It returns a proto that can be passed to a keys.ProtoHandler to get a crypto.Signer.
    45  	NewKeyProto keys.ProtoGenerator
    46  	// SetProcessStatus sets the current process status for diagnostic purposes.
    47  	SetProcessStatus func(string)
    48  }