9 The morl may be a zio.Message or a zio.Message.label 11 See also zio.Message.label_object 15 if type(morl)
is bytes:
16 morl = morl.decode(
'utf-8')
18 return json.loads(morl)
23 Return a flow label string of given flow type and any extra 26 params = params
or dict()
27 params[
'flow'] = flowtype
28 return json.dumps(params)
32 if isinstance(fobj, str):
33 fobj = json.loads(fobj)
36 if fobj[
"direction"] ==
'inject':
37 fobj[
"direction"] =
'extract' 38 elif fobj[
"direction"] ==
'extract':
39 fobj[
"direction"] =
'inject' 41 raise KeyError(
'direction')
46 Return a simple dictionary of message header info. 49 d[
'origin'] = msg.origin
50 d[
'granule'] = msg.granule
51 d[
'seqno'] = msg.seqno
def stringify(flowtype, params)
def switch_direction(fobj)