github.com/kumasuke120/mockuma@v1.1.9/internal/mckmaps/const.go (about)

     1  package mckmaps
     2  
     3  // types
     4  const (
     5  	tMain     = "main"
     6  	tMappings = "mappings"
     7  	tTemplate = "template"
     8  	tVars     = "vars"
     9  )
    10  
    11  // directives
    12  const (
    13  	dFile     = "@file"
    14  	dComment  = "@comment"
    15  	dTemplate = "@template"
    16  	dVars     = "@vars"
    17  	dRegexp   = "@regexp"
    18  	dJSON     = "@json"
    19  )
    20  
    21  // attributes
    22  const (
    23  	aType    = "type"
    24  	aInclude = "include"
    25  	aConfig  = "config"
    26  
    27  	aConfigCORS               = "cors"
    28  	aConfigMatchTrailingSlash = "matchTrailingSlash"
    29  
    30  	aMapURI      = "uri"
    31  	aMapMethod   = "method"
    32  	aMapPolicies = "policies"
    33  )
    34  
    35  const (
    36  	corsEnabled          = "enabled"
    37  	corsAllowCredentials = "allowCredentials"
    38  	corsMaxAge           = "maxAge"
    39  	corsAllowedOrigins   = "allowedOrigins"
    40  	corsAllowedMethods   = "allowedMethods"
    41  	corsAllowedHeaders   = "allowedHeaders"
    42  	corsExposedHeaders   = "exposedHeaders"
    43  )
    44  
    45  const (
    46  	mapPolicyWhen      = "when"
    47  	mapPolicyReturns   = "returns"
    48  	mapPolicyForwards  = "forwards"
    49  	mapPolicyRedirects = "redirects"
    50  )
    51  
    52  // commands of mappings policies
    53  var mapPolicyCommands = []string{mapPolicyReturns, mapPolicyForwards, mapPolicyRedirects}
    54  
    55  // attributes for mappings policies
    56  const (
    57  	pStatusCode = "statusCode"
    58  	pHeaders    = "headers"
    59  	pParams     = "params"
    60  	pPathVars   = "pathVars"
    61  	pBody       = "body"
    62  	pLatency    = "latency"
    63  	pPath       = "path"
    64  )