usdr

package
v0.0.0-...-f36794c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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

func NewCFDANumber(s string) (v cfdaNumber, err error)

Types

type AdditionalInformation

type AdditionalInformation struct {
	Eligibility string `json:"eligibility,omitempty"`
	Text        string `json:"text,omitempty"`
	Url         string `json:"url,omitempty"`
}

type Agency

type Agency struct {
	Name string `json:"name,omitempty"`
	Code string `json:"code,omitempty"`
}

type Applicant

type Applicant struct {
	Name applicantName `json:"name,omitempty"`
	Code applicantCode `json:"code,omitempty"`
}

func ApplicantFromCode

func ApplicantFromCode(code string) (app Applicant, err error)

func ApplicantFromName

func ApplicantFromName(name string) (app Applicant, err error)

func (*Applicant) Validate

func (a *Applicant) Validate() error

type Award

type Award struct {
	Ceiling                      string `json:"ceiling,omitempty"`
	Floor                        string `json:"floor,omitempty"`
	EstimatedTotalProgramFunding string `json:"estimated_total_program_funding,omitempty"`
	ExpectedNumberOfAwards       uint64 `json:"expected_number_of_awards,omitempty"`
}

type CloseDate

type CloseDate struct {
	Date        *Date  `json:"date,omitempty"`
	Explanation string `json:"explanation,omitempty"`
}

type Date

type Date time.Time

func (Date) MarshalJSON

func (d Date) MarshalJSON() ([]byte, error)

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(b []byte) error

type Email

type Email struct {
	Address     string `json:"email,omitempty"`
	Description string `json:"description,omitempty"`
}

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"`
}

func (*Grant) Validate

func (g *Grant) Validate() error

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 GrantorContact struct {
	Email Email  `json:"email,omitempty"`
	Text  string `json:"text,omitempty"`
}

type Metadata

type Metadata struct {
	Version string `json:"version,omitempty"`
}

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

type Revision

type Revision struct {
	Id ulid.ULID `json:"id,omitempty"`
}

func (Revision) MarshalJSON

func (r Revision) MarshalJSON() ([]byte, error)

func (Revision) Time

func (r Revision) Time() time.Time

func (*Revision) Validate

func (r *Revision) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL