Documentation ¶
Index ¶
- Constants
- Variables
- func NewCFDANumber(s string) (v cfdaNumber, err error)
- type AdditionalInformation
- type Agency
- type Applicant
- type Award
- type CloseDate
- type Date
- type Email
- type FundingActivity
- type FundingActivityCategory
- type FundingInstrument
- type Grant
- type GrantModificationEvent
- type GrantorContact
- type Metadata
- type Opportunity
- type OpportunityCategory
- type OpportunityMilestones
- type Revision
Constants ¶
View Source
const ( EventTypeCreate string = "create" EventTypeUpdate string = "update" EventTypeDelete string = "delete" )
View Source
const DateLayout = time.DateOnly
Variables ¶
View Source
var ( ValidCFDANumberRegexp = regexp.MustCompile(`^[0-9]{2}[\.][0-9]{3}$`) ErrInvalidCFDANumber = errors.New("invalid CFDA number") )
View Source
var (
ErrInvalidApplicant = errors.New("invalid applicant")
)
View Source
var (
ErrInvalidFundingActivityCategory = errors.New("invalid funding activity category")
)
View Source
var (
ErrInvalidFundingInstrument = errors.New("invalid funding instrument")
)
View Source
var (
ErrInvalidOpportunityCategory = errors.New("invalid opportunity category")
)
View Source
var ErrUnknonwModificationScenario = errors.New("modification scenario is not one of create, update, delete")
Functions ¶
func NewCFDANumber ¶
Types ¶
type AdditionalInformation ¶
type Applicant ¶
type Applicant struct { Name applicantName `json:"name,omitempty"` Code applicantCode `json:"code,omitempty"` }
func ApplicantFromCode ¶
func ApplicantFromName ¶
type FundingActivity ¶
type FundingActivity struct { Categories []FundingActivityCategory `json:"categories,omitempty"` Explanation string `json:"explanation,omitempty"` }
func (*FundingActivity) Validate ¶
func (f *FundingActivity) Validate() error
type FundingActivityCategory ¶
type FundingActivityCategory struct { Name fundingActivityCategoryName `json:"name,omitempty"` Code fundingActivityCategoryCode `json:"code,omitempty"` }
func FundingActivityCategoryFromCode ¶
func FundingActivityCategoryFromCode(code string) (cat FundingActivityCategory, err error)
func FundingActivityCategoryFromName ¶
func FundingActivityCategoryFromName(name string) (cat FundingActivityCategory, err error)
func (*FundingActivityCategory) Validate ¶
func (f *FundingActivityCategory) Validate() error
type FundingInstrument ¶
type FundingInstrument struct { Name fundingInstrumentName `json:"name,omitempty"` Code fundingInstrumentCode `json:"code,omitempty"` }
func FundingInstrumentFromCode ¶
func FundingInstrumentFromCode(code string) (inst FundingInstrument, err error)
func FundingInstrumentFromName ¶
func FundingInstrumentFromName(name string) (inst FundingInstrument, err error)
func (*FundingInstrument) Validate ¶
func (f *FundingInstrument) Validate() error
type Grant ¶
type Grant struct { FundingInstrumentTypes []FundingInstrument `json:"funding_instrument_types,omitempty"` CostSharingOrMatchingRequirement *bool `json:"cost_sharing_or_matching_requirement,omitempty"` CFDANumbers []cfdaNumber `json:"cfda_numbers,omitempty"` Bill string `json:"bill,omitempty"` EligibleApplicants []Applicant `json:"eligible_applicants,omitempty"` AdditionalInformation AdditionalInformation `json:"additional_information,omitempty"` Agency Agency `json:"agency,omitempty"` Award Award `json:"award,omitempty"` FundingActivity FundingActivity `json:"funding_activity,omitempty"` Grantor GrantorContact `json:"grantor,omitempty"` Metadata Metadata `json:"metadata,omitempty"` Opportunity Opportunity `json:"opportunity,omitempty"` Revision Revision `json:"revision,omitempty"` }
type GrantModificationEvent ¶
type GrantModificationEvent struct { Type grantModificationEventType `json:"type,omitempty"` Versions grantModificationEventVersions `json:"versions,omitempty"` }
func NewGrantModificationEvent ¶
func NewGrantModificationEvent(newVersion, previousVersion *Grant) (*GrantModificationEvent, error)
func (*GrantModificationEvent) Validate ¶
func (e *GrantModificationEvent) Validate() error
type GrantorContact ¶
type Opportunity ¶
type Opportunity struct { Id string `json:"id,omitempty"` Number string `json:"number,omitempty"` Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` Category OpportunityCategory `json:"category,omitempty"` Milestones OpportunityMilestones `json:"milestones,omitempty"` LastUpdated *Date `json:"last_updated,omitempty"` }
func (*Opportunity) Validate ¶
func (o *Opportunity) Validate() error
type OpportunityCategory ¶
type OpportunityCategory struct { Name opportunityCategoryName `json:"name,omitempty"` Code opportunityCategoryCode `json:"code,omitempty"` Explanation string `json:"explanation,omitempty"` }
func OpportunityCategoryFromCode ¶
func OpportunityCategoryFromCode(code string) (cat OpportunityCategory, err error)
func OpportunityCategoryFromName ¶
func OpportunityCategoryFromName(name string) (cat OpportunityCategory, err error)
func (*OpportunityCategory) Validate ¶
func (o *OpportunityCategory) Validate() error
type OpportunityMilestones ¶
type OpportunityMilestones struct { PostDate *Date `json:"post_date,omitempty"` Close CloseDate `json:"close,omitempty"` ArchiveDate *Date `json:"archive_date,omitempty"` }
func (*OpportunityMilestones) Validate ¶
func (o *OpportunityMilestones) Validate() error
Click to show internal directories.
Click to hide internal directories.