models

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateUSSBaseURL

func ValidateUSSBaseURL(s string) error

ValidateUSSBaseURL ensures https

Types

type ID

type ID string

ID models the id of an entity.

func (ID) Empty

func (id ID) Empty() bool

Empty returns true if id indicates an empty ID.

func (ID) String

func (id ID) String() string

String returns the string representation of id.

type OVN

type OVN string

OVN models an opaque version number.

func NewOVNFromTime

func NewOVNFromTime(t time.Time, salt string) OVN

NewOVNFromTime encodes t as an OVN.

func (OVN) Empty

func (ovn OVN) Empty() bool

Empty returns true if ovn indicates an empty opaque version number.

func (OVN) String

func (ovn OVN) String() string

func (OVN) Valid

func (ovn OVN) Valid() bool

Valid returns true if ovn is valid.

type Operation

type Operation struct {
	ID             ID
	Version        Version
	OVN            OVN
	Owner          dssmodels.Owner
	StartTime      *time.Time
	EndTime        *time.Time
	AltitudeLower  *float32
	AltitudeUpper  *float32
	USSBaseURL     string
	State          OperationState
	Cells          s2.CellUnion
	SubscriptionID ID
}

Operation models an operation.

func (*Operation) ToProto

func (o *Operation) ToProto() (*scdpb.OperationReference, error)

ToProto converts the Operation to its proto API format

func (*Operation) ValidateTimeRange

func (o *Operation) ValidateTimeRange() error

ValidateTimeRange validates the time range of o.

type OperationState

type OperationState string

OperationState models the state of an operation.

const (
	OperationStateUnknown       OperationState = ""
	OperationStateAccepted      OperationState = "Accepted"
	OperationStateActivated     OperationState = "Activated"
	OperationStateNonConforming OperationState = "NonConforming"
	OperationStateContingent    OperationState = "Contingent"
	OperationStateEnded         OperationState = "Ended"
)

Aggregates constants for operations.

type Subscription

type Subscription struct {
	ID                ID
	Version           Version
	NotificationIndex int
	Owner             dssmodels.Owner
	StartTime         *time.Time
	EndTime           *time.Time
	AltitudeHi        *float32
	AltitudeLo        *float32

	BaseURL              string
	NotifyForOperations  bool
	NotifyForConstraints bool
	ImplicitSubscription bool
	DependentOperations  []ID
	Cells                s2.CellUnion
}

Subscription represents an SCD subscription

func (*Subscription) AdjustTimeRange

func (s *Subscription) AdjustTimeRange(now time.Time, old *Subscription) error

AdjustTimeRange adjusts the time range to the max allowed ranges on a subscription.

func (*Subscription) ToProto

func (s *Subscription) ToProto() (*scdpb.Subscription, error)

ToProto converts the Subscription to its proto API format

type Version

type Version int32

Version models the version of an entity.

Primarily used as a fencing token in data mutations.

func (Version) Empty

func (v Version) Empty() bool

Empty returns true if the value of v indicates an empty version.

func (Version) Matches

func (v Version) Matches(w Version) bool

Matches returns true if v matches w.

Jump to

Keyboard shortcuts

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