Documentation ¶
Index ¶
- Constants
- Variables
- func BuildDescibeDBInstancesRequest(instanceName *string) *rds.DescribeDBInstancesInput
- type AreaBasicData
- type AreaName
- type AreaParams
- type AreaRelationShips
- type AreaSeeding
- type AreaType
- type AreaTypeSeeding
- type AreasAncestors
- type AreasDataResults
- type DatabaseSchema
- type Error
- type ErrorResponse
- func NewBodyReadError(ctx context.Context, err error) *ErrorResponse
- func NewBodyUnmarshalError(ctx context.Context, err error) *ErrorResponse
- func NewDBReadError(ctx context.Context, err error) *ErrorResponse
- func NewErrorResponse(statusCode int, headers map[string]string, errors ...error) *ErrorResponse
- type SuccessResponse
Constants ¶
const ( AcceptLanguageHeaderError = "ErrorAcceptLanguageHeader" AreaDataIdGetError = "ErrorRetrievingAreaCode" AreaDataIdUpsertError = "AreaDataIdUpsertError" AncestryDataGetError = "ErrorRetrievingAncestryData" MarshallingAreaDataError = "ErrorMarshallingAreaData" MarshallingAreaRelationshipsError = "ErrorMarshallingAreaRelationshipData" InvalidAreaCodeError = "InvalidAreaCode" AreaNameNotProvidedError = "AreaNameNotProvidedError" InvalidAreaTypeError = "InvalidAreaType" AreaNameActiveFromNotProvidedError = "AreaNameActiveFromNotProvidedError" AreaNameActiveToNotProvidedError = "AreaNameActiveToNotProvidedError" AreaNameDetailsNotProvidedError = "AreaNameDetailsNotProvidedError" BodyCloseError = "BodyCloseError" BodyReadError = "RequestBodyReadError" JSONUnmarshalError = "JSONUnmarshalError" )
API error codes
const ( AcceptLanguageHeaderNotFoundDescription = "accept language header not found" AcceptLanguageHeaderInvalidDescription = "accept language header invalid" AreaDataGetErrorDescription = "area code not found" BodyClosedFailedDescription = "the request body failed to close" BodyReadFailedDescription = "endpoint returned an error reading the request body" ErrorUnmarshalFailedDescription = "failed to unmarshal the request body" InvalidAreaCodeErrorDescription = "the area code could not be validated" AreaNameDetailsNotProvidedErrorDescription = "required field area_name not provided" AreaNameNotProvidedErrorDescription = "required field area_name.name not provided" AreaNameActiveFromNotProvidedErrorDescription = "required field area_name.active_from not provided" AreaNameActiveToNotProvidedErrorDescription = "required field area_name.active_to not provided" InvalidAreaTypeErrorDescription = "failed to derive area type from area code" )
API error descriptions
Variables ¶
var ( AcceptLanguageHeaderName = "Accept-Language" AcceptLanguageMapping = map[string]string{ "en": "English", "cy": "Cymraeg", } )
var (
CreateTableQuery = "CREATE TABLE IF NOT EXISTS %s (PRIMARY KEY (%s), %s)"
)
Functions ¶
func BuildDescibeDBInstancesRequest ¶ added in v0.8.0
func BuildDescibeDBInstancesRequest(instanceName *string) *rds.DescribeDBInstancesInput
BuildDescibeDBInstancesRequest builds a correctly populated DescribeDBInstancesInput object using the required db instance name
Types ¶
type AreaBasicData ¶ added in v0.10.0
AreaRelationShips represents the related areas with self ref
type AreaName ¶ added in v0.11.0
type AreaName struct { Name string `json:"name"` ActiveFrom *time.Time `json:"active_from"` ActiveTo *time.Time `json:"active_to"` }
AreaName represents the structure of the area name details used for update request
type AreaParams ¶ added in v0.11.0
type AreaParams struct { Code string `json:"code"` AreaName *AreaName `json:"area_name"` GeometricData string `json:"geometry"` ActiveFrom *time.Time `json:"active_from"` ActiveTo *time.Time `json:"active_to"` Visible *bool `json:"visible"` AreaType string ParentCode string `json:"parent_code"` AreaHectares float64 `json:"area_hectares"` }
AreaParams represents the structure of the area used for create or update
func (*AreaParams) SetAreaType ¶ added in v0.11.0
func (a *AreaParams) SetAreaType(ctx context.Context)
func (*AreaParams) ValidateAreaRequest ¶ added in v0.11.0
func (a *AreaParams) ValidateAreaRequest(ctx context.Context) []error
type AreaRelationShips ¶ added in v0.7.0
type AreaRelationShips struct { AreaCode string `json:"area_code"` AreaName string `json:"area_name"` Href string `json:"href"` }
AreaRelationShips represents the related areas with self ref
type AreaSeeding ¶ added in v0.11.0
type AreaSeeding struct {
Areas map[string]interface{}
}
Struct for seeding area table with test data
type AreaTypeSeeding ¶ added in v0.11.0
Struct for seeding area_type table with test data
type AreasAncestors ¶ added in v0.10.0
AreasAncestors represents the Ancestry structure.
type AreasDataResults ¶ added in v0.6.0
type AreasDataResults struct { Code string `json:"code"` Name *string `json:"name"` GeometricData [][][2]float64 `json:"geometry"` Visible *bool `json:"visible"` AreaType *string `json:"area_type"` Ancestors []AreasAncestors `json:"ancestors"` }
AreasDataResults represents the structure for an area in api v1.
type DatabaseSchema ¶ added in v0.9.0
type DatabaseSchema struct { DBName, SchemaString string ExecutionList []string Tables map[string]map[string]interface{} }
DatabaseSchema database schema model
func (*DatabaseSchema) BuildDatabaseSchemaModel ¶ added in v0.9.0
func (db *DatabaseSchema) BuildDatabaseSchemaModel() error
BuildDatabaseSchemaModel build db schema model
func (*DatabaseSchema) TableSchemaBuilder ¶ added in v0.9.0
func (db *DatabaseSchema) TableSchemaBuilder()
TableSchemaBuilder builds table schema
type Error ¶ added in v0.6.0
type Error struct { Cause error `json:"-"` Code string `json:"code"` Description string `json:"description"` }
func NewValidationError ¶ added in v0.6.0
type ErrorResponse ¶ added in v0.6.0
type ErrorResponse struct { Errors []error `json:"errors"` Status int `json:"-"` Headers map[string]string `json:"-"` }
func NewBodyReadError ¶ added in v0.11.0
func NewBodyReadError(ctx context.Context, err error) *ErrorResponse
func NewBodyUnmarshalError ¶ added in v0.11.0
func NewBodyUnmarshalError(ctx context.Context, err error) *ErrorResponse
func NewDBReadError ¶ added in v0.11.0
func NewDBReadError(ctx context.Context, err error) *ErrorResponse
func NewErrorResponse ¶ added in v0.6.0
func NewErrorResponse(statusCode int, headers map[string]string, errors ...error) *ErrorResponse
type SuccessResponse ¶ added in v0.6.0
type SuccessResponse struct { Body []byte `json:"-"` Status int `json:"-"` Headers map[string]string `json:"-"` }
func NewSuccessResponse ¶ added in v0.6.0
func NewSuccessResponse(jsonBody []byte, statusCode int, headers map[string]string) *SuccessResponse