MCPcopy Index your code
hub / github.com/NdoleStudio/httpsms / Sanitize

Method Sanitize

api/pkg/requests/message_index_request.go:24–40  ·  view source on GitHub ↗

Sanitize sets defaults to MessageOutstanding

()

Source from the content-addressed store, hash-verified

22
23// Sanitize sets defaults to MessageOutstanding
24func (input *MessageIndex) Sanitize() MessageIndex {
25 if strings.TrimSpace(input.Limit) == "" {
26 input.Limit = "20"
27 }
28
29 input.Query = strings.TrimSpace(input.Query)
30
31 input.Owner = input.sanitizeAddress(input.Owner)
32 input.Contact = input.sanitizeAddress(input.Contact)
33
34 input.Skip = strings.TrimSpace(input.Skip)
35 if input.Skip == "" {
36 input.Skip = "0"
37 }
38
39 return *input
40}
41
42// ToGetParams converts request to services.MessageGetParams
43func (input *MessageIndex) ToGetParams(userID entities.UserID) services.MessageGetParams {

Callers 1

IndexMethod · 0.95

Calls 1

sanitizeAddressMethod · 0.95

Tested by

no test coverage detected