synchronization_server

package
v1.1.22-fix12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOrCreateClientID added in v1.1.23

func GetOrCreateClientID(ctx context.Context, projectName string, synchronizationClient *SynchronizationClient, stagesStorage storage.StagesStorage) (string, error)

func HandleRequest

func HandleRequest(w http.ResponseWriter, r *http.Request, request, response interface{}, actionFunc func())

func PerformPost

func PerformPost(client *http.Client, url string, request, response interface{}) error

func RunSynchronizationServer

func RunSynchronizationServer(ctx context.Context, ip, port string, distributedLockerBackendFactoryFunc func(clientID string) (distributed_locker.DistributedLockerBackend, error), stagesStorageCacheFactoryFunc func(clientID string) (storage.StagesStorageCache, error)) error

Types

type DeleteAllStagesRequest

type DeleteAllStagesRequest struct {
	ProjectName string `json:"projectName"`
}

type DeleteAllStagesResponse

type DeleteAllStagesResponse struct {
	Err util.SerializableError `json:"err"`
}

type DeleteStagesBySignatureRequest

type DeleteStagesBySignatureRequest struct {
	ProjectName string `json:"projectName"`
	Signature   string `json:"signature"`
}

type DeleteStagesBySignatureResponse

type DeleteStagesBySignatureResponse struct {
	Err util.SerializableError `json:"err"`
}

type GetAllStagesRequest

type GetAllStagesRequest struct {
	ProjectName string `json:"projectName"`
}

type GetAllStagesResponse

type GetAllStagesResponse struct {
	Err    util.SerializableError `json:"err"`
	Found  bool                   `json:"found"`
	Stages []image.StageID        `json:"stages"`
}

type GetStagesBySignatureRequest

type GetStagesBySignatureRequest struct {
	ProjectName string `json:"projectName"`
	Signature   string `json:"signature"`
}

type GetStagesBySignatureResponse

type GetStagesBySignatureResponse struct {
	Err    util.SerializableError `json:"err"`
	Found  bool                   `json:"found"`
	Stages []image.StageID        `json:"stages"`
}

type HealthRequest added in v1.1.23

type HealthRequest struct {
	Echo string `json:"echo"`
}

type HealthResponse added in v1.1.23

type HealthResponse struct {
	Err    util.SerializableError `json:"err"`
	Echo   string                 `json:"echo"`
	Status string                 `json:"status"`
}

type NewClientIDRequest added in v1.1.23

type NewClientIDRequest struct{}

type NewClientIDResponse added in v1.1.23

type NewClientIDResponse struct {
	Err      util.SerializableError `json:"err"`
	ClientID string                 `json:"clientID"`
}

type StagesStorageCacheHttpClient

type StagesStorageCacheHttpClient struct {
	URL        string
	HttpClient *http.Client
}

func NewStagesStorageCacheHttpClient

func NewStagesStorageCacheHttpClient(url string) *StagesStorageCacheHttpClient

func (*StagesStorageCacheHttpClient) DeleteAllStages

func (client *StagesStorageCacheHttpClient) DeleteAllStages(_ context.Context, projectName string) error

func (*StagesStorageCacheHttpClient) DeleteStagesBySignature

func (client *StagesStorageCacheHttpClient) DeleteStagesBySignature(_ context.Context, projectName, signature string) error

func (*StagesStorageCacheHttpClient) GetAllStages

func (client *StagesStorageCacheHttpClient) GetAllStages(_ context.Context, projectName string) (bool, []image.StageID, error)

func (*StagesStorageCacheHttpClient) GetStagesBySignature

func (client *StagesStorageCacheHttpClient) GetStagesBySignature(_ context.Context, projectName, signature string) (bool, []image.StageID, error)

func (*StagesStorageCacheHttpClient) StoreStagesBySignature

func (client *StagesStorageCacheHttpClient) StoreStagesBySignature(_ context.Context, projectName, signature string, stages []image.StageID) error

func (*StagesStorageCacheHttpClient) String

func (client *StagesStorageCacheHttpClient) String() string

type StagesStorageCacheHttpHandler

type StagesStorageCacheHttpHandler struct {
	*http.ServeMux
	StagesStorageCache storage.StagesStorageCache
}

func NewStagesStorageCacheHttpHandler

func NewStagesStorageCacheHttpHandler(ctx context.Context, stagesStorageCache storage.StagesStorageCache) *StagesStorageCacheHttpHandler

type StoreStagesBySignatureRequest

type StoreStagesBySignatureRequest struct {
	ProjectName string          `json:"projectName"`
	Signature   string          `json:"signature"`
	Stages      []image.StageID `json:"stages"`
}

type StoreStagesBySignatureResponse

type StoreStagesBySignatureResponse struct {
	Err util.SerializableError `json:"err"`
}

type SynchronizationClient added in v1.1.23

type SynchronizationClient struct {
	HttpClient *http.Client
	URL        string
}

func NewSynchronizationClient added in v1.1.23

func NewSynchronizationClient(url string) *SynchronizationClient

func (*SynchronizationClient) NewClientID added in v1.1.23

func (client *SynchronizationClient) NewClientID() (string, error)

type SynchronizationServerHandler

type SynchronizationServerHandler struct {
	*http.ServeMux

	DistributedLockerBackendFactoryFunc func(clientID string) (distributed_locker.DistributedLockerBackend, error)
	StagesStorageCacheFactoryFunc       func(clientID string) (storage.StagesStorageCache, error)

	SynchronizationServerByClientID map[string]*SynchronizationServerHandlerByClientID
	// contains filtered or unexported fields
}

func NewSynchronizationServerHandler

func NewSynchronizationServerHandler(ctx context.Context, distributedLockerBackendFactoryFunc func(clientID string) (distributed_locker.DistributedLockerBackend, error), stagesStorageCacheFactoryFunc func(requestID string) (storage.StagesStorageCache, error)) *SynchronizationServerHandler

type SynchronizationServerHandlerByClientID

type SynchronizationServerHandlerByClientID struct {
	*http.ServeMux
	ClientID string

	DistributedLockerBackend distributed_locker.DistributedLockerBackend
	StagesStorageCache       storage.StagesStorageCache
	// contains filtered or unexported fields
}

func NewSynchronizationServerHandlerByClientID

func NewSynchronizationServerHandlerByClientID(ctx context.Context, clientID string, distributedLockerBackend distributed_locker.DistributedLockerBackend, stagesStorageCache storage.StagesStorageCache) *SynchronizationServerHandlerByClientID

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL