Documentation ¶
Overview ¶
* Copyright 2019 the Astrolabe contributors * SPDX-License-Identifier: Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- func ZipProtectedEntity(ctx context.Context, entity ProtectedEntity, writer io.Writer) error
- type CopyCreateOptions
- type DataTransport
- type GenericTask
- func (this GenericTask) Cancel() error
- func (this GenericTask) GetDetails() string
- func (this GenericTask) GetFinishedTime() time.Time
- func (this GenericTask) GetModelTaskInfo() models.TaskInfo
- func (this GenericTask) GetProgress() float64
- func (this GenericTask) GetResult() interface{}
- func (this GenericTask) GetStartedTime() time.Time
- func (this GenericTask) GetStatus() TaskStatus
- func (this GenericTask) GetTaskID() TaskID
- func (this GenericTask) GetTaskStatus() TaskStatus
- type ProtectedEntity
- type ProtectedEntityID
- func NewProtectedEntityID(peType string, id string) ProtectedEntityID
- func NewProtectedEntityIDFromModel(mpei models.ProtectedEntityID) (ProtectedEntityID, error)
- func NewProtectedEntityIDFromString(peiString string) (returnPEI ProtectedEntityID, returnError error)
- func NewProtectedEntityIDWithSnapshotID(peType string, id string, snapshotID ProtectedEntitySnapshotID) ProtectedEntityID
- func (this ProtectedEntityID) GetID() string
- func (this ProtectedEntityID) GetModelProtectedEntityID() models.ProtectedEntityID
- func (this ProtectedEntityID) GetPeType() string
- func (this ProtectedEntityID) GetSnapshotID() ProtectedEntitySnapshotID
- func (this ProtectedEntityID) HasSnapshot() bool
- func (this ProtectedEntityID) MarshalJSON() ([]byte, error)
- func (this ProtectedEntityID) String() string
- func (this *ProtectedEntityID) UnmarshalJSON(b []byte) error
- type ProtectedEntityInfo
- type ProtectedEntityInfoImpl
- func (this *ProtectedEntityInfoImpl) FillFromModel(jsonStruct models.ProtectedEntityInfo) error
- func (this ProtectedEntityInfoImpl) GetCombinedTransports() []DataTransport
- func (this ProtectedEntityInfoImpl) GetComponentIDs() []ProtectedEntityID
- func (this ProtectedEntityInfoImpl) GetDataTransports() []DataTransport
- func (this ProtectedEntityInfoImpl) GetID() ProtectedEntityID
- func (this ProtectedEntityInfoImpl) GetMetadataTransports() []DataTransport
- func (this ProtectedEntityInfoImpl) GetModelProtectedEntityInfo() models.ProtectedEntityInfo
- func (this ProtectedEntityInfoImpl) GetName() string
- func (this ProtectedEntityInfoImpl) MarshalJSON() ([]byte, error)
- func (this *ProtectedEntityInfoImpl) UnmarshalJSON(data []byte) error
- type ProtectedEntityManager
- type ProtectedEntitySnapshotID
- type ProtectedEntityTypeManager
- type Task
- type TaskID
- type TaskStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ZipProtectedEntity ¶
Types ¶
type CopyCreateOptions ¶
type CopyCreateOptions int
const ( AllocateNewObject CopyCreateOptions = 1 UpdateExistingObject CopyCreateOptions = 2 AllocateObjectWithID CopyCreateOptions = 3 )
type DataTransport ¶
type DataTransport struct {
// contains filtered or unexported fields
}
func NewDataTransport ¶
func NewDataTransport(transportType string, params map[string]string) DataTransport
func NewDataTransportForS3 ¶
func NewDataTransportForS3(host string, bucket string, key string) DataTransport
func NewDataTransportForS3URL ¶
func NewDataTransportForS3URL(url string) DataTransport
func (DataTransport) GetTransportType ¶
func (this DataTransport) GetTransportType() string
func (DataTransport) MarshalJSON ¶
func (this DataTransport) MarshalJSON() ([]byte, error)
func (*DataTransport) UnmarshalJSON ¶
func (this *DataTransport) UnmarshalJSON(data []byte) error
type GenericTask ¶
type GenericTask struct { // Fields are public so we don't need setters from users of this structure ID TaskID Completed bool TaskStatus TaskStatus Details string StartedTime, FinishedTime time.Time Progress float64 Result interface{} }
func NewGenericTask ¶
func NewGenericTask() GenericTask
func (GenericTask) Cancel ¶
func (this GenericTask) Cancel() error
func (GenericTask) GetDetails ¶
func (this GenericTask) GetDetails() string
func (GenericTask) GetFinishedTime ¶
func (this GenericTask) GetFinishedTime() time.Time
func (GenericTask) GetModelTaskInfo ¶
func (this GenericTask) GetModelTaskInfo() models.TaskInfo
func (GenericTask) GetProgress ¶
func (this GenericTask) GetProgress() float64
func (GenericTask) GetResult ¶
func (this GenericTask) GetResult() interface{}
func (GenericTask) GetStartedTime ¶
func (this GenericTask) GetStartedTime() time.Time
func (GenericTask) GetStatus ¶
func (this GenericTask) GetStatus() TaskStatus
func (GenericTask) GetTaskID ¶
func (this GenericTask) GetTaskID() TaskID
func (GenericTask) GetTaskStatus ¶
func (this GenericTask) GetTaskStatus() TaskStatus
type ProtectedEntity ¶
type ProtectedEntity interface { GetInfo(ctx context.Context) (ProtectedEntityInfo, error) GetCombinedInfo(ctx context.Context) ([]ProtectedEntityInfo, error) /* * Snapshot APIs */ Snapshot(ctx context.Context) (ProtectedEntitySnapshotID, error) ListSnapshots(ctx context.Context) ([]ProtectedEntitySnapshotID, error) DeleteSnapshot(ctx context.Context, snapshotToDelete ProtectedEntitySnapshotID) (bool, error) GetInfoForSnapshot(ctx context.Context, snapshotID ProtectedEntitySnapshotID) (*ProtectedEntityInfo, error) GetComponents(ctx context.Context) ([]ProtectedEntity, error) GetID() ProtectedEntityID // GetDataReader returns a reader for the data of the ProtectedEntity. The ProtectedEntity will pick the // best data path to provide the Reader stream. If the ProtectedEntity does not have any data, nil will be // returned GetDataReader(ctx context.Context) (io.ReadCloser, error) // GetMetadataReader returns a reader for the metadata of the ProtectedEntity. The ProtectedEntity will pick the // best data path to provide the Reader stream. If the ProtectedEntity does not have any metadata, nil will be // returned GetMetadataReader(ctx context.Context) (io.Reader, error) }
type ProtectedEntityID ¶
type ProtectedEntityID struct {
// contains filtered or unexported fields
}
func NewProtectedEntityID ¶
func NewProtectedEntityID(peType string, id string) ProtectedEntityID
func NewProtectedEntityIDFromModel ¶
func NewProtectedEntityIDFromModel(mpei models.ProtectedEntityID) (ProtectedEntityID, error)
func NewProtectedEntityIDFromString ¶
func NewProtectedEntityIDFromString(peiString string) (returnPEI ProtectedEntityID, returnError error)
func NewProtectedEntityIDWithSnapshotID ¶
func NewProtectedEntityIDWithSnapshotID(peType string, id string, snapshotID ProtectedEntitySnapshotID) ProtectedEntityID
func (ProtectedEntityID) GetID ¶
func (this ProtectedEntityID) GetID() string
func (ProtectedEntityID) GetModelProtectedEntityID ¶
func (this ProtectedEntityID) GetModelProtectedEntityID() models.ProtectedEntityID
func (ProtectedEntityID) GetPeType ¶
func (this ProtectedEntityID) GetPeType() string
func (ProtectedEntityID) GetSnapshotID ¶
func (this ProtectedEntityID) GetSnapshotID() ProtectedEntitySnapshotID
func (ProtectedEntityID) HasSnapshot ¶
func (this ProtectedEntityID) HasSnapshot() bool
func (ProtectedEntityID) MarshalJSON ¶
func (this ProtectedEntityID) MarshalJSON() ([]byte, error)
func (ProtectedEntityID) String ¶
func (this ProtectedEntityID) String() string
func (*ProtectedEntityID) UnmarshalJSON ¶
func (this *ProtectedEntityID) UnmarshalJSON(b []byte) error
type ProtectedEntityInfo ¶
type ProtectedEntityInfo interface { GetID() ProtectedEntityID GetName() string GetDataTransports() []DataTransport GetMetadataTransports() []DataTransport GetCombinedTransports() []DataTransport GetComponentIDs() []ProtectedEntityID GetModelProtectedEntityInfo() models.ProtectedEntityInfo }
func NewProtectedEntityInfo ¶
func NewProtectedEntityInfo(id ProtectedEntityID, name string, dataTransports []DataTransport, metadataTransports []DataTransport, combinedTransports []DataTransport, componentIDs []ProtectedEntityID) ProtectedEntityInfo
func NewProtectedEntityInfoFromModel ¶
func NewProtectedEntityInfoFromModel(mpei models.ProtectedEntityInfo) (ProtectedEntityInfo, error)
type ProtectedEntityInfoImpl ¶
type ProtectedEntityInfoImpl struct {
// contains filtered or unexported fields
}
func (*ProtectedEntityInfoImpl) FillFromModel ¶
func (this *ProtectedEntityInfoImpl) FillFromModel(jsonStruct models.ProtectedEntityInfo) error
func (ProtectedEntityInfoImpl) GetCombinedTransports ¶
func (this ProtectedEntityInfoImpl) GetCombinedTransports() []DataTransport
func (ProtectedEntityInfoImpl) GetComponentIDs ¶
func (this ProtectedEntityInfoImpl) GetComponentIDs() []ProtectedEntityID
func (ProtectedEntityInfoImpl) GetDataTransports ¶
func (this ProtectedEntityInfoImpl) GetDataTransports() []DataTransport
func (ProtectedEntityInfoImpl) GetID ¶
func (this ProtectedEntityInfoImpl) GetID() ProtectedEntityID
func (ProtectedEntityInfoImpl) GetMetadataTransports ¶
func (this ProtectedEntityInfoImpl) GetMetadataTransports() []DataTransport
func (ProtectedEntityInfoImpl) GetModelProtectedEntityInfo ¶
func (this ProtectedEntityInfoImpl) GetModelProtectedEntityInfo() models.ProtectedEntityInfo
func (ProtectedEntityInfoImpl) GetName ¶
func (this ProtectedEntityInfoImpl) GetName() string
func (ProtectedEntityInfoImpl) MarshalJSON ¶
func (this ProtectedEntityInfoImpl) MarshalJSON() ([]byte, error)
func (*ProtectedEntityInfoImpl) UnmarshalJSON ¶
func (this *ProtectedEntityInfoImpl) UnmarshalJSON(data []byte) error
type ProtectedEntityManager ¶
type ProtectedEntityManager interface { GetProtectedEntity(ctx context.Context, id ProtectedEntityID) (ProtectedEntity, error) GetProtectedEntityTypeManager(peType string) ProtectedEntityTypeManager ListEntityTypeManagers() []ProtectedEntityTypeManager }
type ProtectedEntitySnapshotID ¶
type ProtectedEntitySnapshotID struct {
// contains filtered or unexported fields
}
func NewProtectedEntitySnapshotID ¶
func NewProtectedEntitySnapshotID(pesiString string) ProtectedEntitySnapshotID
func (ProtectedEntitySnapshotID) GetID ¶
func (this ProtectedEntitySnapshotID) GetID() string
func (ProtectedEntitySnapshotID) GetModelProtectedEntitySnapshotID ¶
func (this ProtectedEntitySnapshotID) GetModelProtectedEntitySnapshotID() models.ProtectedEntitySnapshotID
func (ProtectedEntitySnapshotID) String ¶
func (this ProtectedEntitySnapshotID) String() string
type ProtectedEntityTypeManager ¶
type ProtectedEntityTypeManager interface { GetTypeName() string GetProtectedEntity(ctx context.Context, id ProtectedEntityID) (ProtectedEntity, error) GetProtectedEntities(ctx context.Context) ([]ProtectedEntityID, error) Copy(ctx context.Context, pe ProtectedEntity, options CopyCreateOptions) (ProtectedEntity, error) CopyFromInfo(ctx context.Context, info ProtectedEntityInfo, options CopyCreateOptions) (ProtectedEntity, error) }
type TaskID ¶
type TaskID struct {
// contains filtered or unexported fields
}
func GenerateTaskID ¶
func GenerateTaskID() TaskID
func (TaskID) GetModelTaskID ¶
type TaskStatus ¶
type TaskStatus int
const ( Running TaskStatus = iota Success Failed Cancelled )
func (TaskStatus) String ¶
func (this TaskStatus) String() string
Click to show internal directories.
Click to hide internal directories.