Documentation
¶
Index ¶
- Constants
- func MockModelServiceMethod(service interface{}, targetModelMethod string, mockFunc interface{}) error
- func MockServiceMethod(client interface{}, targetServiceMethod string, mockFunc interface{}) error
- type AmendWellPermitsRequest
- type AuthType
- type Client
- type ClientOptionFunc
- type ConstructionModel
- type ContactModel
- type ContactPhoneNumberModel
- type DefaultDrillerService
- func (service *DefaultDrillerService) Count() (int, error)
- func (service *DefaultDrillerService) Create(model *DrillerModel) (*DrillerModel, error)
- func (service *DefaultDrillerService) Get(ID uint) (*DrillerModel, error)
- func (service *DefaultDrillerService) Init(spec *ServiceSpec) *DefaultDrillerService
- func (service *DefaultDrillerService) List(from int, size int, sort []Sort, ids []uint) ([]*DrillerModel, error)
- type DefaultHistoryService
- func (service *DefaultHistoryService) Count() (int, error)
- func (service *DefaultHistoryService) Get(updateID string) (*HistoryModel, error)
- func (service *DefaultHistoryService) Init(spec *ServiceSpec) *DefaultHistoryService
- func (service *DefaultHistoryService) List(from int, size int, sort []Sort, updateIds []string, modelType string) ([]*HistoryModel, error)
- type DefaultMeterReadingService
- func (service *DefaultMeterReadingService) CountByWell(wellID uint) (int, error)
- func (service *DefaultMeterReadingService) CountByWellAndMeter(wellID uint, meterID uint) (int, error)
- func (service *DefaultMeterReadingService) Get(wellID uint, meterID uint, ID uint) (*MeterReadingModel, error)
- func (service *DefaultMeterReadingService) GetProductionByWell(wellID uint, fromDate *time.Time, toDate *time.Time, estimateBounds bool) ([]ProductionModel, error)
- func (service *DefaultMeterReadingService) GetProductionByWellAndMeter(wellID uint, meterID uint, fromDate *time.Time, toDate *time.Time, ...) (*ProductionModel, error)
- func (service *DefaultMeterReadingService) Init(spec *ServiceSpec) *DefaultMeterReadingService
- func (service *DefaultMeterReadingService) ListByWell(wellID uint, from int, size int, sort []Sort, startDate *time.Time, ...) ([]MeterReadingModel, error)
- func (service *DefaultMeterReadingService) ListByWellAndMeter(wellID uint, meterID uint, from int, size int, sort []Sort, ...) ([]MeterReadingModel, error)
- type DefaultMeterService
- func (service *DefaultMeterService) Create(model *MeterModel) (*MeterModel, error)
- func (service *DefaultMeterService) Decommission(id uint, decommissionDate time.Time) (*MeterModel, error)
- func (service *DefaultMeterService) Get(wellID uint, ID uint) (*MeterModel, error)
- func (service *DefaultMeterService) Init(spec *ServiceSpec) *DefaultMeterService
- func (service *DefaultMeterService) ListByWellID(wellID uint) ([]MeterModel, error)
- func (service *DefaultMeterService) Update(model *MeterModel) (*MeterModel, error)
- type DefaultModelBase
- type DefaultPermitService
- func (service *DefaultPermitService) AmendWellPermits(wellID uint, amendWellPermitsRequest AmendWellPermitsRequest) ([]PermitModel, error)
- func (service *DefaultPermitService) Count() (int, error)
- func (service *DefaultPermitService) Get(ID uint) (*PermitModel, error)
- func (service *DefaultPermitService) Init(spec *ServiceSpec) *DefaultPermitService
- func (service *DefaultPermitService) List(from int, size int, sort []Sort, ids []uint, aggregate bool) ([]*PermitModel, error)
- type DefaultService
- type DefaultWellService
- func (service *DefaultWellService) Count() (int, error)
- func (service *DefaultWellService) Create(model *WellModel) (*WellModel, error)
- func (service *DefaultWellService) Get(ID uint) (*WellModel, error)
- func (service *DefaultWellService) GetWellsByIDs(ids []uint) ([]WellModel, error)
- func (service *DefaultWellService) Init(spec *ServiceSpec) *DefaultWellService
- func (service *DefaultWellService) List(from int, size int, sort []Sort, ids []uint) ([]*WellModel, error)
- func (service *DefaultWellService) Search(query string, filters []string, from int, size int, sort []Sort) (*WellSearchResults, error)
- type DrillerModel
- type DrillerPhoneNumberModel
- type DrillerService
- type DrillingCompanyModel
- type DrillingCompanyPhoneNumberModel
- type ErrorResponse
- type GamLayerAlias
- type GamLayerRecord
- type HistoryModel
- type HistoryService
- type LocationModel
- type MeterModel
- type MeterReadingModel
- type MeterReadingService
- type MeterService
- type ModelServiceCallMock
- type PermitMetricsModel
- type PermitModel
- type PermitService
- type PermitTemplateModel
- type PhoneNumberModel
- type ProductionModel
- type RequestHeader
- type ScreenRecord
- type SecondaryStatusModel
- type Service
- type ServiceSpec
- type Sort
- type SortDirection
- type StatusModel
- type SystemModel
- type WellModel
- func (model *WellModel) Delete() error
- func (model *WellModel) Init(spec *ServiceSpec) *WellModel
- func (model *WellModel) Permits() ([]*PermitModel, error)
- func (model *WellModel) Save() (*WellModel, error)
- func (model *WellModel) TriggerUpdate() (*WellModel, error)
- func (model *WellModel) Update(JSONMergePatch []byte) (*WellModel, error)
- type WellSearchResults
- type WellService
- type WellTankModel
- type WellUse
Constants ¶
const ( // DefaultURL default URL DefaultURL = "https://localhost" // DefaultAuthType default authentication type DefaultAuthType = AuthTypeOpenID )
Variables ¶
This section is empty.
Functions ¶
func MockModelServiceMethod ¶
func MockModelServiceMethod(service interface{}, targetModelMethod string, mockFunc interface{}) error
MockModelServiceMethod mock a service method on a payload model
func MockServiceMethod ¶
MockServiceMethod mock a method on a service
Types ¶
type AmendWellPermitsRequest ¶
type AuthType ¶
type AuthType string
AuthType client authentication type
const (
AuthTypeOpenID AuthType = "openID"
)
AuthType constants
type Client ¶
type Client struct {
AuthType AuthType
AccessToken string
CreateHeadersFunc func() []RequestHeader
URL *url.URL
HTTPClient http.Client
Driller DrillerService
History HistoryService
Meter MeterService
MeterReading MeterReadingService
Permit PermitService
Well WellService
}
Client Hydros API client
func NewClient ¶
func NewClient(options ...ClientOptionFunc) (*Client, error)
NewClient Creates instance of *Client
type ClientOptionFunc ¶
ClientOptionFunc Hydros API client option
func SetAccessToken ¶
func SetAccessToken(accessToken string) ClientOptionFunc
SetAccessToken sets a global access token to be used for client for duration of session
func SetHost ¶
func SetHost(host string) ClientOptionFunc
SetHost updates host URL API calls are made against. Otherwise, the default URL is used
type ConstructionModel ¶
type ConstructionModel struct {
ID uint `json:"id,omitempty"`
CasingLimit null.String `json:"casingLimit"`
CasingSize null.Float `json:"casingSize,omitempty"`
CasingMaterial null.String `json:"casingMaterial,omitempty"`
InsideDiameter null.Float `json:"insideDiameter,omitempty"`
Depth null.Float `json:"depth,omitempty"`
MaxPumpProduction null.Int `json:"maxPumpProduction,omitempty"`
WithdrawalMethod null.String `json:"withdrawalMethod,omitempty"`
PumpingCapacity null.Float `json:"pumpingCapacity,omitempty"`
PumpMotorSize null.String `json:"pumpMotorSize,omitempty"`
PumpPowerSource null.String `json:"pumpPowerSource,omitempty"`
PumpBowlSize null.Float `json:"pumpBowlSize,omitempty"`
PumpBowlStages null.Int `json:"pumpBowlNumStages,omitempty"`
PumpColumnLength null.Float `json:"pumpColumnLength,omitempty"`
PumpDepth null.Float `json:"pumpDepth,omitempty"`
ServiceConnections null.Int `json:"serviceConnections,omitempty"`
IndividualsServiced null.Int `json:"individualsServiced,omitempty"`
DaysServicedPerYear null.Int `json:"daysServicedPerYear,omitempty"`
Confined bool `json:"confined,omitempty"`
Screens []*ScreenRecord `json:"screens,omitempty"`
GamLayerAlias *GamLayerAlias `json:"gamLayerAlias,omitempty"`
GamLayer *GamLayerRecord `json:"gamLayer,omitempty"`
}
ConstructionModel construction model for well association
type ContactModel ¶
type ContactModel struct {
*DefaultModelBase
FirstName null.String `json:"firstName"`
LastName null.String `json:"lastName"`
CompanyName null.String `json:"companyName"`
Email null.String `json:"email"`
Address1 null.String `json:"streetAddress1"`
Address2 null.String `json:"streetAddress2"`
City null.String `json:"city"`
State null.String `json:"state"`
PostalCode null.String `json:"postalCode"`
Classification null.String `json:"classification"`
PhoneNumbers []*ContactPhoneNumberModel `json:"phoneNumbers,omitempty"`
Verified bool `json:"verified"`
}
ContactModel Contact response payload
type ContactPhoneNumberModel ¶
type ContactPhoneNumberModel struct {
*PhoneNumberModel
}
ContactPhoneNumberModel phone number model for contact association
type DefaultDrillerService ¶
type DefaultDrillerService struct {
*DefaultService
GetFunc func(ID uint) (*DrillerModel, error)
CountFunc func() (int, error)
ListFunc func(from int, size int, sort []Sort, ids []uint) ([]*DrillerModel, error)
CreateFunc func(model *DrillerModel) (*DrillerModel, error)
}
DefaultDrillerService default driller service struct that contains backing functions
func (*DefaultDrillerService) Count ¶
func (service *DefaultDrillerService) Count() (int, error)
Count Get a total number of objects
func (*DefaultDrillerService) Create ¶
func (service *DefaultDrillerService) Create(model *DrillerModel) (*DrillerModel, error)
Create Create new
func (*DefaultDrillerService) Get ¶
func (service *DefaultDrillerService) Get(ID uint) (*DrillerModel, error)
Get Get payload object by id
func (*DefaultDrillerService) Init ¶
func (service *DefaultDrillerService) Init(spec *ServiceSpec) *DefaultDrillerService
Init Initializes spec and default backing functions for service
func (*DefaultDrillerService) List ¶
func (service *DefaultDrillerService) List(from int, size int, sort []Sort, ids []uint) ([]*DrillerModel, error)
List List objects for service
type DefaultHistoryService ¶
type DefaultHistoryService struct {
*DefaultService
GetFunc func(updateID string) (*HistoryModel, error)
CountFunc func() (int, error)
ListFunc func(from int, size int, sort []Sort, updateIds []string, modelType string) ([]*HistoryModel, error)
}
DefaultHistoryService default history service struct that contains backing functions
func (*DefaultHistoryService) Count ¶
func (service *DefaultHistoryService) Count() (int, error)
Count get a total number of objects
func (*DefaultHistoryService) Get ¶
func (service *DefaultHistoryService) Get(updateID string) (*HistoryModel, error)
Get payload object by id
func (*DefaultHistoryService) Init ¶
func (service *DefaultHistoryService) Init(spec *ServiceSpec) *DefaultHistoryService
Init initialized spec and default backing functions for service
func (*DefaultHistoryService) List ¶
func (service *DefaultHistoryService) List(from int, size int, sort []Sort, updateIds []string, modelType string) ([]*HistoryModel, error)
List object for service
type DefaultMeterReadingService ¶
type DefaultMeterReadingService struct {
*DefaultService
GetFunc func(wellID uint, meterID uint, ID uint) (*MeterReadingModel, error)
CountByWellFunc func(wellID uint) (int, error)
CountByWellAndMeterFunc func(wellID uint, meterID uint) (int, error)
ListByWellFunc func(wellID uint, from int, size int, sort []Sort, startDate *time.Time, endDate *time.Time) ([]MeterReadingModel, error)
ListByWellAndMeterFunc func(wellID uint, meterID uint, from int, size int, sort []Sort, startDate *time.Time, endDate *time.Time) ([]MeterReadingModel, error)
GetProductionByWellFunc func(wellID uint, fromDate *time.Time, toDate *time.Time, estimateBounds bool) ([]ProductionModel, error)
GetProductionByWellAndMeterFunc func(wellID uint, meterID uint, fromDate *time.Time, toDate *time.Time, estimateBounds bool) (*ProductionModel, error)
}
DefaultMeterReadingService default meter reading service struct that contains backing functions
func (*DefaultMeterReadingService) CountByWell ¶
func (service *DefaultMeterReadingService) CountByWell(wellID uint) (int, error)
Get meter reading count by well id
func (*DefaultMeterReadingService) CountByWellAndMeter ¶
func (service *DefaultMeterReadingService) CountByWellAndMeter(wellID uint, meterID uint) (int, error)
Get meter reading count by well id and meter id
func (*DefaultMeterReadingService) Get ¶
func (service *DefaultMeterReadingService) Get(wellID uint, meterID uint, ID uint) (*MeterReadingModel, error)
Get meter reading by id
func (*DefaultMeterReadingService) GetProductionByWell ¶
func (service *DefaultMeterReadingService) GetProductionByWell(wellID uint, fromDate *time.Time, toDate *time.Time, estimateBounds bool) ([]ProductionModel, error)
Get production by well id
func (*DefaultMeterReadingService) GetProductionByWellAndMeter ¶
func (service *DefaultMeterReadingService) GetProductionByWellAndMeter(wellID uint, meterID uint, fromDate *time.Time, toDate *time.Time, estimateBounds bool) (*ProductionModel, error)
Get production by well id and meter id
func (*DefaultMeterReadingService) Init ¶
func (service *DefaultMeterReadingService) Init(spec *ServiceSpec) *DefaultMeterReadingService
Init initalized spec and default backing functions for service
func (*DefaultMeterReadingService) ListByWell ¶
func (service *DefaultMeterReadingService) ListByWell(wellID uint, from int, size int, sort []Sort, startDate *time.Time, endDate *time.Time) ([]MeterReadingModel, error)
Get meter readings by well id
func (*DefaultMeterReadingService) ListByWellAndMeter ¶
func (service *DefaultMeterReadingService) ListByWellAndMeter(wellID uint, meterID uint, from int, size int, sort []Sort, startDate *time.Time, endDate *time.Time) ([]MeterReadingModel, error)
Get meter readings by well id and meter id
type DefaultMeterService ¶
type DefaultMeterService struct {
*DefaultService
GetFunc func(wellID uint, ID uint) (*MeterModel, error)
ListByWellIDFunc func(wellID uint) ([]MeterModel, error)
CreateFunc func(model *MeterModel) (*MeterModel, error)
UpdateFunc func(model *MeterModel) (*MeterModel, error)
DecommissionFunc func(id uint, decommissionTime time.Time) (*MeterModel, error)
}
DefaultMeterService default meter service struct that contains backing functions
func (*DefaultMeterService) Create ¶
func (service *DefaultMeterService) Create(model *MeterModel) (*MeterModel, error)
Create Create new
func (*DefaultMeterService) Decommission ¶
func (service *DefaultMeterService) Decommission(id uint, decommissionDate time.Time) (*MeterModel, error)
Decommission Decommission model
func (*DefaultMeterService) Get ¶
func (service *DefaultMeterService) Get(wellID uint, ID uint) (*MeterModel, error)
Get Get payload object by id
func (*DefaultMeterService) Init ¶
func (service *DefaultMeterService) Init(spec *ServiceSpec) *DefaultMeterService
Init initialized spec and default backing functions for service
func (*DefaultMeterService) ListByWellID ¶
func (service *DefaultMeterService) ListByWellID(wellID uint) ([]MeterModel, error)
List Get list of meters for well
func (*DefaultMeterService) Update ¶
func (service *DefaultMeterService) Update(model *MeterModel) (*MeterModel, error)
Update Update model
type DefaultModelBase ¶
type DefaultModelBase struct {
Spec *ServiceSpec `json:"-"`
ID uint `json:"id"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
DefaultModelBase Standard model base struct
type DefaultPermitService ¶
type DefaultPermitService struct {
*DefaultService
GetFunc func(ID uint) (*PermitModel, error)
CountFunc func() (int, error)
ListFunc func(from int, size int, sort []Sort, ids []uint, aggregate bool) ([]*PermitModel, error)
AmendWellPermitsFunc func(wellID uint, amendWellPermitsRequest AmendWellPermitsRequest) ([]PermitModel, error)
}
DefaultPermitService default permit service struct that contains backing functions
func (*DefaultPermitService) AmendWellPermits ¶
func (service *DefaultPermitService) AmendWellPermits(wellID uint, amendWellPermitsRequest AmendWellPermitsRequest) ([]PermitModel, error)
AmendWellPermits amend well's permits
func (*DefaultPermitService) Count ¶
func (service *DefaultPermitService) Count() (int, error)
AmendWellPermits amend well's permits
func (*DefaultPermitService) Get ¶
func (service *DefaultPermitService) Get(ID uint) (*PermitModel, error)
Get permit by id
func (*DefaultPermitService) Init ¶
func (service *DefaultPermitService) Init(spec *ServiceSpec) *DefaultPermitService
Init initialized spec and default backing functions for service
func (*DefaultPermitService) List ¶
func (service *DefaultPermitService) List(from int, size int, sort []Sort, ids []uint, aggregate bool) ([]*PermitModel, error)
AmendWellPermits amend well's permits
type DefaultService ¶
type DefaultService struct {
Spec *ServiceSpec
}
DefaultService Standard service base struct that implements Service
type DefaultWellService ¶
type DefaultWellService struct {
*DefaultService
GetFunc func(ID uint) (*WellModel, error)
GetWellsByIDsFunc func(ids []uint) ([]WellModel, error)
CountFunc func() (int, error)
ListFunc func(from int, size int, sort []Sort, ids []uint) ([]*WellModel, error)
SearchFunc func(query string, filters []string, from int, size int, sort []Sort) (*WellSearchResults, error)
CreateFunc func(model *WellModel) (*WellModel, error)
}
DefaultWellService default well service struct that contains backing functions
func (*DefaultWellService) Count ¶
func (service *DefaultWellService) Count() (int, error)
Count Get a total number of objects
func (*DefaultWellService) Create ¶
func (service *DefaultWellService) Create(model *WellModel) (*WellModel, error)
Create Create new
func (*DefaultWellService) Get ¶
func (service *DefaultWellService) Get(ID uint) (*WellModel, error)
Get Get payload object by id
func (*DefaultWellService) GetWellsByIDs ¶
func (service *DefaultWellService) GetWellsByIDs(ids []uint) ([]WellModel, error)
Get Get wells by ids
func (*DefaultWellService) Init ¶
func (service *DefaultWellService) Init(spec *ServiceSpec) *DefaultWellService
Init Initializes spec and default backing functions for service
func (*DefaultWellService) List ¶
func (service *DefaultWellService) List(from int, size int, sort []Sort, ids []uint) ([]*WellModel, error)
List List objects for service
func (*DefaultWellService) Search ¶
func (service *DefaultWellService) Search(query string, filters []string, from int, size int, sort []Sort) (*WellSearchResults, error)
Search wells
type DrillerModel ¶
type DrillerModel struct {
*DefaultModelBase
LicenseNumber null.String `json:"licenseNumber"`
LicenseExpirationDate null.String `json:"licenseExpirationDate"`
LicenseIssuerTerritory null.String `json:"licenseIssuerTerritory"`
CompanyName null.String `json:"companyName"`
FirstName null.String `json:"firstName"`
LastName null.String `json:"lastName"`
Email null.String `json:"email"`
StreetAddress1 null.String `json:"streetAddress1"`
StreetAddress2 null.String `json:"streetAddress2"`
City null.String `json:"city"`
State null.String `json:"state"`
PostalCode null.String `json:"postalCode"`
PhoneNumbers []*PhoneNumberModel `json:"phoneNumbers"`
// contains filtered or unexported fields
}
DrillerModel Driller response payload
func (*DrillerModel) Init ¶
func (model *DrillerModel) Init(spec *ServiceSpec) *DrillerModel
Init Initializes spec and default backing functions for model instance
func (*DrillerModel) Save ¶
func (model *DrillerModel) Save() (*DrillerModel, error)
Save changed model
type DrillerPhoneNumberModel ¶
type DrillerPhoneNumberModel struct {
*PhoneNumberModel
}
DrillerPhoneNumberModel phone number model for driller association
type DrillerService ¶
type DrillerService interface {
Service
Get(ID uint) (*DrillerModel, error)
Count() (int, error)
List(from int, size int, sort []Sort, ids []uint) ([]*DrillerModel, error)
Create(model *DrillerModel) (*DrillerModel, error)
}
DrillerService Driller service interface
func NewDrillerService ¶
func NewDrillerService(client *Client) DrillerService
NewDrillerService creates & initializes new driller service
type DrillingCompanyModel ¶
type DrillingCompanyModel struct {
*DefaultModelBase
City null.String `json:"city"`
CompanyID uint `json:"companyId"`
CompanyName null.String `json:"companyName"`
CreatedAt time.Time `json:"createdAt"`
CreatedBy string `json:"createdBy"`
DeletedAt *time.Time `json:"deletedAt"`
Email null.String `json:"email"`
FirstName null.String `json:"firstName"`
LastName null.String `json:"lastName"`
Notes null.String `json:"notes"`
PhoneNumbers []*PhoneNumberModel `json:"phoneNumbers"`
Pinned bool `json:"pinned"`
PostalCode null.String `json:"postalCode"`
State null.String `json:"state"`
StreetAddress1 null.String `json:"streetAddress1"`
StreetAddress2 null.String `json:"streetAddress2"`
UpdatedAt time.Time `json:"updatedAt"`
UpdatedBy string `json:"updatedBy"`
// contains filtered or unexported fields
}
DrillingCompanyModel Drilling Company response payload
func (*DrillingCompanyModel) Delete ¶
func (model *DrillingCompanyModel) Delete() error
Delete model
func (*DrillingCompanyModel) GetID ¶
func (model *DrillingCompanyModel) GetID() uint
GetID getter for id attribute
func (*DrillingCompanyModel) Init ¶
func (model *DrillingCompanyModel) Init(spec *ServiceSpec) *DrillingCompanyModel
Init Initializes spec and default backing functions for model instance
func (*DrillingCompanyModel) Save ¶
func (model *DrillingCompanyModel) Save() (*DrillingCompanyModel, error)
Save changed model
type DrillingCompanyPhoneNumberModel ¶
type DrillingCompanyPhoneNumberModel struct {
*PhoneNumberModel
}
DrillingCompanyPhoneNumberModel phone number model for drilling company association
type ErrorResponse ¶
type ErrorResponse struct {
Message string `json:"message"`
Description string `json:"description"`
}
ErrorResponse error response payload
type GamLayerAlias ¶
type GamLayerAlias struct {
ID uint `json:"id,omitempty"`
LayerID uint `json:"layerId,omitempty"`
Alias string `json:"alias,omitempty"`
LongAlias string `json:"longAlias,omitempty"`
}
GamLayerAlias payload
type GamLayerRecord ¶
type GamLayerRecord struct {
ID uint `json:"id,omitempty"`
Name null.String `json:"name,omitempty"`
}
GamLayerRecord model
type HistoryModel ¶
type HistoryModel struct {
*DefaultModelBase
UpdateID string `json:"updateId"`
CompanyID string `json:"companyId"`
Type string `json:"type"`
Operation string `json:"operation"`
Patch string `json:"patch"`
Snapshot string `json:"snapshot"`
}
HistoryModel History response payload
func (*HistoryModel) GetUpdateID ¶
func (model *HistoryModel) GetUpdateID() string
GetUpdateID getter for Update ID attributes
func (*HistoryModel) Init ¶
func (model *HistoryModel) Init(spec *ServiceSpec) *HistoryModel
Init Initialized spec and default backing functions for model instance
type HistoryService ¶
type HistoryService interface {
Service
Get(updateID string) (*HistoryModel, error)
Count() (int, error)
List(from int, size int, sort []Sort, updateIds []string, modelType string) ([]*HistoryModel, error)
}
HistoryService History service interface
func NewHistoryService ¶
func NewHistoryService(client *Client) HistoryService
NewHistoryService creates & initialized new history service
type LocationModel ¶
type LocationModel struct {
ID uint `json:"id,omitempty"`
Latitude null.Float `json:"latitude,omitempty"`
Longitude null.Float `json:"longitude,omitempty"`
LatLonSource null.String `json:"latLonSource,omitempty"`
Section null.String `json:"section,omitempty"`
Block null.String `json:"block,omitempty"`
Elevation null.Float `json:"elevation,omitempty"`
PhysicalLocation null.String `json:"physicalLocation"`
Address1 null.String `json:"address1,omitempty"`
Address2 null.String `json:"address2,omitempty"`
County null.String `json:"county,omitempty"`
City null.String `json:"city,omitempty"`
State null.String `json:"state,omitempty"`
PostalCode null.String `json:"postalCode,omitempty"`
ParcelId null.Int `json:"parcelId"`
Grid25TexasId null.String `json:"grid25TexasId,omitempty"`
GpsManufacturer null.String `json:"gpsManufacturer,omitempty"`
GpsModel null.String `json:"gpsModel,omitempty"`
QuarterQuad null.String `json:"quarterQuad,omitempty"`
DistanceToPropertyLine1 null.Int `json:"distanceToPropertyLine1,omitempty"`
DistanceToPropertyLine2 null.Int `json:"distanceToPropertyLine2,omitempty"`
DistanceToPropertyLine1Type null.String `json:"distanceToPropertyLine1Type,omitempty"`
DistanceToPropertyLine2Type null.String `json:"distanceToPropertyLine2Type,omitempty"`
ContinuousAcredTotal null.Float `json:"continuousAcredTotal,omitempty"`
DistNearestWellOnProperty null.Float `json:"distNearestWellOnProperty,omitempty"`
}
LocationModel location model for well association
type MeterModel ¶
type MeterModel struct {
*DefaultModelBase
Name string `json:"name"`
Make string `json:"make"`
Model string `json:"model"`
SerialNumber string `json:"serialNumber"`
StartReading int `json:"startReading"`
Unit string `json:"unit"`
Active bool `json:"active"`
DateInService time.Time `json:"dateInService"`
DecomissionDate *time.Time `json:"decomissionDate,omitempty"`
Wells []WellModel `json:"wells"`
}
MeterModel Meter response payload
func (*MeterModel) Init ¶
func (model *MeterModel) Init(spec *ServiceSpec) *MeterModel
Init Initalized spec and default backing functions for model instance
type MeterReadingModel ¶
type MeterReadingModel struct {
*DefaultModelBase
MeterID uint `json:"meterId"`
Reading float64 `json:"reading"`
ReadingDate *time.Time `json:"readingDate"`
Notes null.String `json:"notes"`
ExtraData postgres.Jsonb `json:"extraData"`
}
MeterReadingModel Meter Reading response payload
func (*MeterReadingModel) GetID ¶
func (model *MeterReadingModel) GetID() uint
GetID getter for id attribute
func (*MeterReadingModel) Init ¶
func (model *MeterReadingModel) Init(spec *ServiceSpec) *MeterReadingModel
Init Initialized spec and default backing functions for model instance
type MeterReadingService ¶
type MeterReadingService interface {
Service
Get(wellID uint, meterID uint, ID uint) (*MeterReadingModel, error)
CountByWell(wellID uint) (int, error)
CountByWellAndMeter(wellID uint, meterID uint) (int, error)
ListByWell(wellID uint, from int, size int, sort []Sort, startDate *time.Time, endDate *time.Time) ([]MeterReadingModel, error)
ListByWellAndMeter(wellID uint, meterID uint, from int, size int, sort []Sort, startDate *time.Time, endDate *time.Time) ([]MeterReadingModel, error)
GetProductionByWell(wellID uint, fromDate *time.Time, toDate *time.Time, estimateBounds bool) ([]ProductionModel, error)
GetProductionByWellAndMeter(wellID uint, meterID uint, fromDate *time.Time, toDate *time.Time, estimateBounds bool) (*ProductionModel, error)
}
MeterReadingService Meter Reading service interface
func NewMeterReadingService ¶
func NewMeterReadingService(client *Client) MeterReadingService
NewMeterReadingService creates initalized new meter reading service
type MeterService ¶
type MeterService interface {
Service
Get(wellID uint, ID uint) (*MeterModel, error)
ListByWellID(wellID uint) ([]MeterModel, error)
Create(model *MeterModel) (*MeterModel, error)
Update(model *MeterModel) (*MeterModel, error)
Decommission(id uint, decommissionTime time.Time) (*MeterModel, error)
}
MeterService Meter service interface
func NewMeterService ¶
func NewMeterService(client *Client) MeterService
NewMeterService creates & initialized new meter service
type ModelServiceCallMock ¶
type ModelServiceCallMock struct {
MockFunc interface{}
}
ModelServiceCallMock holds mock definition for service instance
type PermitMetricsModel ¶
type PermitMetricsModel struct {
PermitsCount int `json:"permitsCount"`
WellsCount int `json:"wellsCount"`
MetersCount int `json:"metersCount"`
OverPermittedProduction bool `json:"overPermittedProduction"`
TotalEstimatedAnnualWaterProduction float32 `json:"totalEstimatedAnnualWaterProduction"`
TotalVolumeProduced float32 `json:"totalVolumeProduced"`
FromDate *time.Time `json:"fromDate"`
ToDate *time.Time `json:"toDate"`
Estimated bool `json:"estimated"`
}
PermitTemplateModel PermitMetricsModel response payload
type PermitModel ¶
type PermitModel struct {
*DefaultModelBase
CompanyID uint `json:"companyId"`
WellID uint `json:"wellId"`
HistoryUpdateID string `json:"historyUpdateId"`
PermitTemplateID uint `json:"permitTemplateId"`
PermitTemplate PermitTemplateModel `json:"permitTemplate"`
SystemID uint `json:"systemId"`
IssuedDate *time.Time `json:"issuedDate"`
ExpirationDate *time.Time `json:"expirationDate"`
TerminationDate *time.Time `json:"terminationDate"`
AdministrativelyComplete bool `json:"administrativelyComplete"`
AdministrativelyCompleteDate *time.Time `json:"administrativelyCompleteDate"`
Aggregate bool `json:"aggregate"`
AggregatePermitID null.Int `json:"aggregatePermitId"`
AggregatedPermits []PermitModel `json:"aggregatedPermits"`
AmendedBy null.Int `json:"amendedBy"`
RequestedAmendPermitID null.Int `json:"requestedAmendPermitID"`
RequestedAggregatePermitID null.Int `json:"requestedAggregatePermitID"`
OperatorFirstName null.String `json:"operatorFirstName"`
OperatorLastName null.String `json:"operatorLastName"`
OperatorCompanyName null.String `json:"operatorCompanyName"`
OperatorEmail null.String `json:"operatorEmail"`
OperatorPhoneNumber1 null.String `json:"operatorPhoneNumber1"`
OperatorPhoneNumber2 null.String `json:"operatorPhoneNumber2"`
OperatorStreetAddress1 null.String `json:"operatorStreetAddress1"`
OperatorStreetAddress2 null.String `json:"operatorStreetAddress2"`
OperatorCity null.String `json:"operatorCity"`
OperatorState null.String `json:"operatorState"`
OperatorPostalCode null.String `json:"operatorPostalCode"`
PendingBoardApproval bool `json:"pendingBoardApproval"`
SpecialTermsAndConditions null.String `json:"specialTermsAndConditions"`
// contains filtered or unexported fields
}
PermitModel Permit response payload
func (*PermitModel) Init ¶
func (model *PermitModel) Init(spec *ServiceSpec) *PermitModel
Init Initialized spec and default backing functions for model instance
func (*PermitModel) Metrics ¶
func (model *PermitModel) Metrics(fromDate *time.Time, toDate *time.Time, estimateBounds bool) (*PermitMetricsModel, error)
Metrics get permit metrics
type PermitService ¶
type PermitService interface {
Service
Get(ID uint) (*PermitModel, error)
Count() (int, error)
List(from int, size int, sort []Sort, ids []uint, aggregate bool) ([]*PermitModel, error)
AmendWellPermits(wellID uint, amendWellPermitsRequest AmendWellPermitsRequest) ([]PermitModel, error)
}
PermitService Permit service interface
func NewPermitService ¶
func NewPermitService(client *Client) PermitService
NewPermitService creates * initialized new permit service
type PermitTemplateModel ¶
type PermitTemplateModel struct {
ID uint `json:"id"`
CompanyID uint `json:"companyId"`
PermitName string `json:"permitName"`
Condition string `json:"condition"`
RequiredFields string `json:"requiredFields"`
DurationDays int `json:"durationDays"`
CanAggregate bool `json:"canAggregate"`
AggregateFields string `json:"aggregateFields"`
}
PermitTemplateModel PermitTemplate response payload
type PhoneNumberModel ¶
type PhoneNumberModel struct {
*DefaultModelBase
Type null.String `json:"numberType"`
PhoneNumber null.String `json:"phoneNumber"`
Primary null.Bool `json:"isPrimary"`
}
PhoneNumberModel phone number payload model
type ProductionModel ¶
type ProductionModel struct {
MeterID uint `json:"meterId"`
Volume float64 `json:"volume"`
FromDate *time.Time `json:"fromDate"`
ToDate *time.Time `json:"toDate"`
Estimated bool `json:"estimated"`
}
ProductionModel Production response payload
type RequestHeader ¶
RequestHeader hold key value pairs
type ScreenRecord ¶
type ScreenRecord struct {
ID uint `json:"id,omitempty"`
TopDepth null.Float `json:"topDepth,omitempty"`
BottomDepth null.Float `json:"bottomDepth,omitempty"`
}
ScreenRecord model
type SecondaryStatusModel ¶
type SecondaryStatusModel struct {
ID uint `json:"id,omitempty"`
SecondaryStatus string `json:"secondaryStatus,omitempty"`
}
SecondaryStatusModel model
type Service ¶
type Service interface {
// contains filtered or unexported methods
}
Service Base interface for services
type ServiceSpec ¶
type ServiceSpec struct {
ServiceName string
Client *Client
PayloadModelType reflect.Type
ModelServiceCallMocks map[string]*ModelServiceCallMock
}
ServiceSpec individual service instance metadata
type Sort ¶
type Sort struct {
Field string `json:"field"`
Direction SortDirection `json:"direction"`
}
Sort struct representing sort parameter of search query
type SortDirection ¶
type SortDirection string
SortDirection the sort direction of the query
const ( Asc SortDirection = "asc" Desc SortDirection = "desc" )
Sort direction constants
type StatusModel ¶
StatusModel status model for well association
type SystemModel ¶
type SystemModel struct {
ID uint `json:"id,omitempty"`
Name null.String `json:"name,omitempty"`
Description null.String `json:"description,omitempty"`
CreatedAt time.Time `json:"createdAt,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
DeletedAt *time.Time `json:"deletedAt,omitempty"`
}
SystemModel model
type WellModel ¶
type WellModel struct {
*DefaultModelBase
Serial string `json:"serial,omitempty"`
Name null.String `json:"name,omitempty"`
StateWellID null.String `json:"stateWellId,omitempty"`
TCEQ null.String `json:"tceq,omitempty"`
Approved bool `json:"approved,omitempty"`
Status *StatusModel `json:"status,omitempty"`
SystemID uint `json:"systemId,omitempty"`
System *SystemModel `json:"system,omitempty"`
Location *LocationModel `json:"location,omitempty"`
SecondaryStatuses []*SecondaryStatusModel `json:"secondaryStatuses,omitempty"`
Contacts []*ContactModel `json:"contacts"`
Owner *ContactModel `json:"owner,omitempty"`
Applicant *ContactModel `json:"applicant,omitempty"`
DrillingCompany *DrillingCompanyModel `json:"drillingCompany,omitempty"`
Driller *DrillerModel `json:"driller,omitempty"`
DrillerIsContact bool `json:"drillerIsContact,omitempty"`
PumpInstaller *DrillerModel `json:"pumpInstaller,omitempty"`
PumpInstallerIsContact bool `json:"pumpInstallerIsContact,omitempty"`
Tank *WellTankModel `json:"tank,omitempty"`
Construction *ConstructionModel `json:"construction,omitempty"`
WellReplacementID uint `json:"wellReplacementId,omitempty"`
EstimatedDrillingDate null.Time `json:"estimatedDrillingDate,omitempty"`
DrillingDate null.Time `json:"drillingDate,omitempty"`
CompletionDate null.Time `json:"completionDate,omitempty"`
ApprovedDate null.Time `json:"approvedDate,omitempty"`
Confidential bool `json:"confidential,omitempty"`
Exempt bool `json:"exempt,omitempty"`
ExemptionType string `json:"exemptionType,omitempty"`
ApplicationType string `json:"applicationType,omitempty"`
InstalledByDriller bool `json:"installedByDriller,omitempty"`
UsedByOtherThanOwner bool `json:"usedByOtherThanOwner,omitempty"`
TransportedOutOfGCD bool `json:"transportedOutOfGCD,omitempty"`
TransportedOutOfGCDDescription null.String `json:"transportedOutOfGCDDescription,omitempty"`
UsedByPublicWaterSystem bool `json:"usedByPublicWaterSystem,omitempty"`
RequestedMonitoring bool `json:"requestedMonitoring,omitempty"`
RequestedGrandfathered bool `json:"requestedGrandfathered,omitempty"`
RequestedExtension bool `json:"requestedExtension,omitempty"`
UseBasedExemption bool `json:"useBasedExemption,omitempty"`
PcbExemptionIndividual bool `json:"pcbExemptionIndividual,omitempty"`
PcbExemptionWellSystem bool `json:"pcbExemptionWellSystem,omitempty"`
CertifiedBeneficial bool `json:"certifiedBeneficial,omitempty"`
CertifiedRules bool `json:"certifiedRules,omitempty"`
LocationTransported null.String `json:"locationTransported,omitempty"`
PreferredPayment string `json:"preferredPayment,omitempty"`
BeneficialUseAgreement bool `json:"beneficialUseAgreement,omitempty"`
DistrictRulesAgreement bool `json:"districtRulesAgreement,omitempty"`
AbideRules bool `json:"abideRules,omitempty"`
MeetsSpacing bool `json:"meetsSpacing,omitempty"`
NeedsProduction bool `json:"needsProduction,omitempty"`
Notes null.String `json:"notes,omitempty"`
WellReportTrackingNumber null.Int `json:"wellReportTrackingNumber,omitempty"`
PluggingReportTrackingNumber null.Int `json:"pluggingReportTrackingNumber,omitempty"`
CertifiedInfoCorrect bool `json:"certifiedInfoCorrect,omitempty"`
MonitoringWellID null.String `json:"monitoringWellId,omitempty"`
ElevationInFeet null.Float `json:"elevationInFeet,omitempty"`
RequestedRescind bool `json:"requestedRescind,omitempty"`
CertifiedMinTractSize bool `json:"certifiedMinTractSize,omitempty"`
CertifiedDistPropertyLine bool `json:"certifiedDistPropertyLine,omitempty"`
CertifiedDistExistingWaterWell bool `json:"certifiedDistExistingWaterWell,omitempty"`
CertifiedLocation bool `json:"certifiedLocation,omitempty"`
CertifiedPluggedCappedGuidelines bool `json:"certifiedPluggedCappedGuidelines,omitempty"`
CertifiedProvideReports bool `json:"certifiedProvideReports,omitempty"`
EstimatedAnnualTransportedGallons null.Int `json:"estimatedAnnualTransportedGallons,omitempty"`
EstimatedAnnualWaterProduction null.Int `json:"estimatedAnnualWaterProduction,omitempty"`
WellLogReceived null.Time `json:"wellLogReceived,omitempty"`
WellUses []WellUse `json:"wellUses"`
StaticAtDrillingDate null.Float `json:"staticAtDrillingDate"`
InUseExplain null.String `json:"inUseExplain"`
OtherWellList null.String `json:"otherWellList"`
PluggedBy *DrillerModel `json:"pluggedBy,omitempty"`
Precinct null.String `json:"precinct"`
PumpInstallationDate null.Time `json:"pumpInstallationDate"`
CreatedAt time.Time `json:"createdAt,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
// contains filtered or unexported fields
}
WellModel Well response payload
func (*WellModel) Init ¶
func (model *WellModel) Init(spec *ServiceSpec) *WellModel
Init Initializes spec and default backing functions for model instance
func (*WellModel) Permits ¶
func (model *WellModel) Permits() ([]*PermitModel, error)
Permits fetch permits
func (*WellModel) TriggerUpdate ¶
TriggerUpdate update well entry in search DB and take snapshot of well state
type WellSearchResults ¶
WellSearchResults total and result list of found wells
type WellService ¶
type WellService interface {
Service
Get(ID uint) (*WellModel, error)
GetWellsByIDs(ids []uint) ([]WellModel, error)
Count() (int, error)
List(from int, size int, sort []Sort, ids []uint) ([]*WellModel, error)
Search(query string, filters []string, from int, size int, sort []Sort) (*WellSearchResults, error)
Create(model *WellModel) (*WellModel, error)
}
WellService Well service interface
func NewWellService ¶
func NewWellService(client *Client) WellService
NewWellService creates & initializes new well service
Source Files
¶
- auth.go
- client.go
- contact_model.go
- driller_model.go
- driller_service.go
- drilling_company_model.go
- error.go
- history_model.go
- history_service.go
- meter_model.go
- meter_reading_model.go
- meter_reading_service.go
- meter_service.go
- mock.go
- model.go
- permit_model.go
- permit_service.go
- phone_number_model.go
- service.go
- well_model.go
- well_service.go