MCPcopy
hub / github.com/tinode/chat / UnmarshalText

Method UnmarshalText

server/store/types/types.go:644–654  ·  view source on GitHub ↗

UnmarshalText parses access mode string as byte slice. Does not change the mode if the string is empty or invalid.

(b []byte)

Source from the content-addressed store, hash-verified

642// UnmarshalText parses access mode string as byte slice.
643// Does not change the mode if the string is empty or invalid.
644func (m *AccessMode) UnmarshalText(b []byte) error {
645 m0, err := ParseAcs(b)
646 if err != nil {
647 return err
648 }
649
650 if m0 != ModeUnset {
651 *m = (m0 & ModeBitmask)
652 }
653 return nil
654}
655
656// String returns string representation of AccessMode.
657func (m AccessMode) String() string {

Callers 5

genDbFunction · 0.95
replyOfflineTopicSetSubFunction · 0.95
UnmarshalJSONMethod · 0.95
ScanMethod · 0.95
ApplyMutationMethod · 0.95

Calls 1

ParseAcsFunction · 0.85

Tested by

no test coverage detected