MCPcopy Index your code
hub / github.com/coder/coder / asRequestOption

Method asRequestOption

codersdk/users.go:40–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38}
39
40func (req UsersRequest) asRequestOption() RequestOption {
41 return func(r *http.Request) {
42 q := r.URL.Query()
43 var params []string
44 if req.Search != "" {
45 params = append(params, req.Search)
46 }
47 if req.Name != "" {
48 params = append(params, "name:"+req.Name)
49 }
50 if req.Status != "" {
51 params = append(params, "status:"+string(req.Status))
52 }
53 if req.Role != "" {
54 params = append(params, "role:"+req.Role)
55 }
56 if req.SearchQuery != "" {
57 params = append(params, req.SearchQuery)
58 }
59 for _, lt := range req.LoginType {
60 params = append(params, "login_type:"+string(lt))
61 }
62 q.Set("q", strings.Join(params, " "))
63 r.URL.RawQuery = q.Encode()
64 }
65}
66
67// MinimalUser is the minimal information needed to identify a user and show
68// them on the UI.

Callers 8

UsersMethod · 0.45
TemplateACLAvailableMethod · 0.45
TemplateDAUsMethod · 0.45
ListChatsMethod · 0.45
ConnectionLogsMethod · 0.45
AuditLogsMethod · 0.45

Calls 2

EncodeMethod · 0.80
SetMethod · 0.65

Tested by

no test coverage detected