github.com/seeker-insurance/kit@v0.0.13/jsonapi/constants.go (about)

     1  package jsonapi
     2  
     3  const (
     4  	// StructTag annotation strings
     5  	annotationJSONAPI   = "jsonapi"
     6  	annotationPrimary   = "primary"
     7  	annotationClientID  = "client-id"
     8  	annotationAttribute = "attr"
     9  	annotationRelation  = "relation"
    10  	annotationOmitEmpty = "omitempty"
    11  	annotationISO8601   = "iso8601"
    12  	annotationSeperator = ","
    13  	annotationIgnore    = "-"
    14  	annotationEmbed     = "embed"
    15  
    16  	iso8601TimeFormat = "2006-01-02T15:04:05Z"
    17  
    18  	// MediaType is the identifier for the JSON API media type
    19  	//
    20  	// see http://jsonapi.org/format/#document-structure
    21  	MediaType = "application/vnd.api+json"
    22  
    23  	// Pagination Constants
    24  	//
    25  	// http://jsonapi.org/format/#fetching-pagination
    26  
    27  	// KeyFirstPage is the key to the links object whose value contains a link to
    28  	// the first page of data
    29  	KeyFirstPage = "first"
    30  	// KeyLastPage is the key to the links object whose value contains a link to
    31  	// the last page of data
    32  	KeyLastPage = "last"
    33  	// KeyPreviousPage is the key to the links object whose value contains a link
    34  	// to the previous page of data
    35  	KeyPreviousPage = "prev"
    36  	// KeyNextPage is the key to the links object whose value contains a link to
    37  	// the next page of data
    38  	KeyNextPage = "next"
    39  
    40  	// QueryParamPageNumber is a JSON API query parameter used in a page based
    41  	// pagination strategy in conjunction with QueryParamPageSize
    42  	QueryParamPageNumber = "page[number]"
    43  	// QueryParamPageSize is a JSON API query parameter used in a page based
    44  	// pagination strategy in conjunction with QueryParamPageNumber
    45  	QueryParamPageSize = "page[size]"
    46  
    47  	// QueryParamPageOffset is a JSON API query parameter used in an offset based
    48  	// pagination strategy in conjunction with QueryParamPageLimit
    49  	QueryParamPageOffset = "page[offset]"
    50  	// QueryParamPageLimit is a JSON API query parameter used in an offset based
    51  	// pagination strategy in conjunction with QueryParamPageOffset
    52  	QueryParamPageLimit = "page[limit]"
    53  
    54  	// QueryParamPageCursor is a JSON API query parameter used with a cursor-based
    55  	// strategy
    56  	QueryParamPageCursor = "page[cursor]"
    57  )