Documentation ¶
Index ¶
- Variables
- func EntryPtr(entry *dinkurapiv1.Entry) (*dinkur.Entry, error)
- func EntryPtrNoNil(entry *dinkurapiv1.Entry) (dinkur.Entry, error)
- func EntrySlice(slice []*dinkurapiv1.Entry) ([]dinkur.Entry, error)
- func Event(ev dinkurapiv1.Event) dinkur.EventType
- func Shorthand(s dinkurapiv1.GetEntryListRequest_Shorthand) timeutil.TimeSpanShorthand
- func StatusPtrNoNil(status *dinkurapiv1.Status) (dinkur.Status, error)
- func TimeOrNow(ts *timestamppb.Timestamp) time.Time
- func TimeOrZero(ts *timestamppb.Timestamp) time.Time
- func TimePtr(ts *timestamppb.Timestamp) *time.Time
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnexpectedNilEntry = errors.New("unexpected nil entry") ErrUnexpectedNilStatus = errors.New("unexpected nil status") )
Errors that are specific to converting gRPC entries to Go.
Functions ¶
func EntryPtr ¶
func EntryPtr(entry *dinkurapiv1.Entry) (*dinkur.Entry, error)
EntryPtr converts a gRPC entry to a Go entry.
func EntryPtrNoNil ¶
func EntryPtrNoNil(entry *dinkurapiv1.Entry) (dinkur.Entry, error)
EntryPtrNoNil converts a gRPC entry to a Go entry, or error if nil.
func EntrySlice ¶
func EntrySlice(slice []*dinkurapiv1.Entry) ([]dinkur.Entry, error)
EntrySlice converts a slice of gRPC entries to Go entries. Nils are skipped.
func Event ¶
func Event(ev dinkurapiv1.Event) dinkur.EventType
Event converts a gRPC event to a Go event.
func Shorthand ¶
func Shorthand(s dinkurapiv1.GetEntryListRequest_Shorthand) timeutil.TimeSpanShorthand
Shorthand converts a gRPC shorthand to a timeutil shorthand.
func StatusPtrNoNil ¶
func StatusPtrNoNil(status *dinkurapiv1.Status) (dinkur.Status, error)
StatusPtrNoNil converts a gRPC status to a dinkur status, or error on nil.
func TimeOrNow ¶
func TimeOrNow(ts *timestamppb.Timestamp) time.Time
TimeOrNow converts gRPC timestamp to Go time, or time.Now() if nil.
func TimeOrZero ¶
func TimeOrZero(ts *timestamppb.Timestamp) time.Time
TimeOrZero converts gRPC timestamp to Go time, or zero if nil.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.