MCPcopy
hub / github.com/ContainerSSH/ContainerSSH / document

Function document

auditlog/message/docs.go:107–119  ·  view source on GitHub ↗
(entity interface{}, docs map[string]string)

Source from the content-addressed store, hash-verified

105}
106
107func document(entity interface{}, docs map[string]string) DocStruct {
108 t := reflect.TypeOf(entity)
109 if t.Kind() == reflect.Ptr {
110 t = t.Elem()
111 }
112 if t.Kind() == reflect.Interface {
113 t = reflect.ValueOf(t).Elem().Type()
114 }
115 if t.Kind() != reflect.Struct {
116 panic(t.Name() + " is not a struct")
117 }
118 return documentType(t, docs)
119}
120
121func resolveTypeName(fieldType reflect.Type) string {
122 switch fieldType.Kind() {

Callers 1

DocumentMessagesFunction · 0.85

Calls 3

documentTypeFunction · 0.85
TypeMethod · 0.65
NameMethod · 0.45

Tested by

no test coverage detected