MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / StdTime

Function StdTime

pkg/ttnpb/stdtime.go:26–32  ·  view source on GitHub ↗

StdTime converts a protobuf timestamp to a standard library time. ProtoTime panics if the time is invalid.

(protoTime *timestamppb.Timestamp)

Source from the content-addressed store, hash-verified

24//
25// ProtoTime panics if the time is invalid.
26func StdTime(protoTime *timestamppb.Timestamp) *time.Time {
27 if protoTime == nil {
28 return nil
29 }
30 stdTime := protoTime.AsTime()
31 return &stdTime
32}
33
34// StdTimeOrZero converts a protobuf time to a standard library time.
35// If protoTime is nil, it returns a zero time.

Callers 15

mac.goFile · 0.92
TestHomeNetworkFunction · 0.92
toPBUplinkFunction · 0.92
TestHandleJoinFunction · 0.92
handleDeviceRegistryTestFunction · 0.92
syncWithUplinkTokenMethod · 0.92
ScheduleAtMethod · 0.92
HandleUpMethod · 0.92
TestUplinkTokenFunction · 0.92
FrontendFunction · 0.92
TestTrafficFunction · 0.92
FromUplinkMessageMethod · 0.92

Calls

no outgoing calls

Tested by 15

TestHomeNetworkFunction · 0.74
TestHandleJoinFunction · 0.74
handleDeviceRegistryTestFunction · 0.74
TestUplinkTokenFunction · 0.74
TestTrafficFunction · 0.74
TestNextDataDownlinkSlotFunction · 0.74
makeOTAAFlowTestFunction · 0.74
AssertJoinMethod · 0.74
TestStatusRawFunction · 0.74
TestToGatewayUpFunction · 0.74
TestUsersCRUDFunction · 0.74