Documentation ¶
Overview ¶
Package deploy supports internal deployment processes.
Index ¶
- Variables
- func DeployKeyTokenSignature(localKey key.Privatekey, token string, networkID base.NetworkID) (key.Signature, error)
- func HookBlockdataCleaner(ctx context.Context) (context.Context, error)
- func HookDeployHandlers(ctx context.Context) (context.Context, error)
- func HookInitializeDeployKeyStorage(ctx context.Context) (context.Context, error)
- func LoadBlockdataCleanerContextValue(ctx context.Context, l **BlockdataCleaner) error
- func LoadDeployHandler(ctx context.Context, l **DeployHandlers) error
- func LoadDeployKeyStorageContextValue(ctx context.Context, l **DeployKeyStorage) error
- func NewDeployKeyKeyHandler(ks *DeployKeyStorage, enc encoder.Encoder) network.HTTPHandlerFunc
- func NewDeployKeyKeysHandler(ks *DeployKeyStorage, enc encoder.Encoder) network.HTTPHandlerFunc
- func NewDeployKeyNewHandler(ks *DeployKeyStorage, enc encoder.Encoder) network.HTTPHandlerFunc
- func NewDeployKeyRevokeHandler(ks *DeployKeyStorage) network.HTTPHandlerFunc
- func NewSetBlockdataMapsHandler(enc encoder.Encoder, db storage.Database, bc *BlockdataCleaner) network.HTTPHandlerFunc
- func UnauthorizedError(w http.ResponseWriter, realm string, err error)
- func VerifyDeployKeyToken(c cache.Cache, localKey key.Publickey, token string, networkID base.NetworkID, ...) error
- type BaseDeployHandler
- type BlockdataCleaner
- type DeployByKeyMiddleware
- type DeployHandlers
- type DeployKey
- type DeployKeyByTokenMiddleware
- type DeployKeyPackerJSON
- type DeployKeyStorage
- func (ks *DeployKeyStorage) Exists(k string) bool
- func (ks *DeployKeyStorage) Key(k string) (DeployKey, bool)
- func (ks *DeployKeyStorage) Len() int
- func (ks *DeployKeyStorage) New() (DeployKey, error)
- func (ks *DeployKeyStorage) Revoke(k string) error
- func (ks *DeployKeyStorage) Traverse(callback func(DeployKey) bool)
- type DeployKeyTokenHandler
- type DeployKeyUnpackerBSON
- type DeployKeyUnpackerJSON
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ContextValueDeployKeyStorage util.ContextKey = "deploy_key_storage" ContextValueBlockdataCleaner util.ContextKey = "blockdata_cleaner" ContextValueDeployHandler util.ContextKey = "deploy_handler" )
View Source
var ( QuicHandlerPathDeployKeyKeys = "/_deploy/key/keys" QuicHandlerPathDeployKeyNew = "/_deploy/key/new" QuicHandlerPathDeployKeyToken = "/_deploy/key/token" // nolint:gosec QuicHandlerPathDeployKeyKeyPrefix = "/_deploy/key" QuicHandlerPathDeployKeyKey = QuicHandlerPathDeployKeyKeyPrefix + QuicHandlerPathDeployKeyKeySuffix )
View Source
var ( RateLimitHandlerNameDeployKeyToken = "deploy-key-token" RateLimitHandlerNameDeployKeyKey = "deploy-key-key" RateLimitHandlerNameDeployKeyKeys = "deploy-key-keys" RateLimitHandlerNameDeployKeyNew = "deploy-key-new" RateLimitHandlerNameDeployKeyRevoke = "deploy-key-revoke" )
View Source
var DatabaseInfoDeployKeysKey = "deploy_keys"
View Source
var DefaultDeployKeyTokenExpired = time.Second * 30
View Source
var DefaultTimeAfterRemoveBlockdataFiles = time.Minute * 30
View Source
var HookNameBlockdataCleaner = "blockdata_cleaner"
View Source
var HookNameDeployHandlers = "deploy_handlers"
View Source
var HookNameInitializeDeployKeyStorage = "initialize_deploy_key_storage"
View Source
var LimitBlockdataMaps = 100
View Source
var QuicHandlerPathDeployKeyKeySuffix = "/{deploy_key:.*}"
View Source
var QuicHandlerPathSetBlockdataMaps = "/_deploy/blockdatamaps"
View Source
var RateLimitHandlerNameSetBlockdataMaps = "set-blockdatamaps"
Functions ¶
func DeployKeyTokenSignature ¶
func LoadBlockdataCleanerContextValue ¶
func LoadBlockdataCleanerContextValue(ctx context.Context, l **BlockdataCleaner) error
func LoadDeployHandler ¶
func LoadDeployHandler(ctx context.Context, l **DeployHandlers) error
func LoadDeployKeyStorageContextValue ¶
func LoadDeployKeyStorageContextValue(ctx context.Context, l **DeployKeyStorage) error
func NewDeployKeyKeyHandler ¶
func NewDeployKeyKeyHandler(ks *DeployKeyStorage, enc encoder.Encoder) network.HTTPHandlerFunc
func NewDeployKeyKeysHandler ¶
func NewDeployKeyKeysHandler(ks *DeployKeyStorage, enc encoder.Encoder) network.HTTPHandlerFunc
func NewDeployKeyNewHandler ¶
func NewDeployKeyNewHandler(ks *DeployKeyStorage, enc encoder.Encoder) network.HTTPHandlerFunc
func NewDeployKeyRevokeHandler ¶
func NewDeployKeyRevokeHandler(ks *DeployKeyStorage) network.HTTPHandlerFunc
func NewSetBlockdataMapsHandler ¶
func NewSetBlockdataMapsHandler( enc encoder.Encoder, db storage.Database, bc *BlockdataCleaner, ) network.HTTPHandlerFunc
func UnauthorizedError ¶
func UnauthorizedError(w http.ResponseWriter, realm string, err error)
Types ¶
type BaseDeployHandler ¶
func NewBaseDeployHandler ¶
type BlockdataCleaner ¶
type BlockdataCleaner struct { sync.RWMutex *logging.Logging *util.ContextDaemon // contains filtered or unexported fields }
func NewBlockdataCleaner ¶
func NewBlockdataCleaner(bd *localfs.Blockdata, removeAfter time.Duration) *BlockdataCleaner
func (*BlockdataCleaner) RemoveAfter ¶
func (bc *BlockdataCleaner) RemoveAfter() time.Duration
func (*BlockdataCleaner) SetLogging ¶
func (bc *BlockdataCleaner) SetLogging(l *logging.Logging) *logging.Logging
type DeployByKeyMiddleware ¶
func NewDeployByKeyMiddleware ¶
func NewDeployByKeyMiddleware(ks *DeployKeyStorage) *DeployByKeyMiddleware
func (*DeployByKeyMiddleware) Middleware ¶
func (md *DeployByKeyMiddleware) Middleware(next http.Handler) http.Handler
type DeployHandlers ¶
type DeployHandlers struct { *BaseDeployHandler // contains filtered or unexported fields }
func NewDeployHandlers ¶
func (*DeployHandlers) SetHandler ¶
type DeployKey ¶
type DeployKey struct {
// contains filtered or unexported fields
}
func NewDeployKey ¶
func NewDeployKey() DeployKey
func (DeployKey) MarshalBSON ¶
func (DeployKey) MarshalJSON ¶
func (*DeployKey) UnmarshalBSON ¶
func (*DeployKey) UnmarshalJSON ¶
type DeployKeyByTokenMiddleware ¶
type DeployKeyByTokenMiddleware struct { *logging.Logging // contains filtered or unexported fields }
func (*DeployKeyByTokenMiddleware) Middleware ¶
func (md *DeployKeyByTokenMiddleware) Middleware(next http.Handler) http.Handler
type DeployKeyPackerJSON ¶
type DeployKeyStorage ¶
func NewDeployKeyStorage ¶
func NewDeployKeyStorage(db storage.Database) (*DeployKeyStorage, error)
func (*DeployKeyStorage) Exists ¶
func (ks *DeployKeyStorage) Exists(k string) bool
func (*DeployKeyStorage) Len ¶
func (ks *DeployKeyStorage) Len() int
func (*DeployKeyStorage) New ¶
func (ks *DeployKeyStorage) New() (DeployKey, error)
func (*DeployKeyStorage) Revoke ¶
func (ks *DeployKeyStorage) Revoke(k string) error
func (*DeployKeyStorage) Traverse ¶
func (ks *DeployKeyStorage) Traverse(callback func(DeployKey) bool)
type DeployKeyTokenHandler ¶
func NewDeployKeyTokenHandler ¶
func NewDeployKeyTokenHandler(c cache.Cache, expired time.Duration) *DeployKeyTokenHandler
func (*DeployKeyTokenHandler) ServeHTTP ¶
func (hn *DeployKeyTokenHandler) ServeHTTP(w http.ResponseWriter, _ *http.Request)
type DeployKeyUnpackerBSON ¶
type DeployKeyUnpackerJSON ¶
Source Files ¶
- context.go
- deploy_handlers.go
- deploy_key_handlers.go
- doc.go
- handler_deploy_key_key.go
- handler_deploy_key_keys.go
- handler_deploy_key_new.go
- handler_deploy_key_revoke.go
- handler_deploy_key_token.go
- handler_deploy_middleware.go
- handler_set_blockdatamap.go
- hook_clean_blockdata.go
- hook_deploy_handlers.go
- hook_deploy_key.go
- key.go
- key_bson.go
- key_encode.go
- key_json.go
- localfs.go
Click to show internal directories.
Click to hide internal directories.