Documentation
¶
Index ¶
- func FetchAndSaveNew(dataDir string) error
- type AIMCMappings
- type AIMCMetadata
- type Client
- func (c *Client) FetchAndUpdate() error
- func (c *Client) GetAllFunds() []string
- func (c *Client) GetCategories() []string
- func (c *Client) GetCategoryName(categoryID string) string
- func (c *Client) GetFundInfo(fundCode string) (legalName, thaiName, firmName, category string)
- func (c *Client) GetFundsByCategory(categoryName string) []string
- func (c *Client) GetFundsByCompany(companyName string) []string
- func (c *Client) GetFundsByCompanyFuzzy(partialName string) []string
- func (c *Client) GetMappings() *Mappings
- func (c *Client) NeedsUpdate() bool
- type FundInfo
- type Mappings
- type MappingsWithMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchAndSaveNew ¶
FetchAndSaveNew fetches AIMC data and saves to the given data directory This is a standalone function to handle the case where no existing data exists
Types ¶
type AIMCMappings ¶
type AIMCMappings struct {
Categories map[string]string `json:"categories"`
Funds map[string]FundInfo `json:"funds"`
}
AIMCMappings stores AIMC category and fund information (legacy structure for compatibility)
type AIMCMetadata ¶
type AIMCMetadata struct {
LastUpdate string `json:"last_update"`
SourceURL string `json:"source_url,omitempty"`
Quarter string `json:"quarter,omitempty"`
RecordCount int `json:"record_count"`
}
AIMCMetadata contains metadata about the AIMC data source
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides AIMC (Association of Investment Management Companies) data lookup
func (*Client) FetchAndUpdate ¶
FetchAndUpdate downloads latest AIMC data and updates the mappings Returns error on failure but existing data remains usable
func (*Client) GetAllFunds ¶
GetAllFunds returns all fund codes
func (*Client) GetCategories ¶
GetCategories returns all available category names
func (*Client) GetCategoryName ¶
GetCategoryName returns the category name for a given category ID
func (*Client) GetFundInfo ¶
GetFundInfo returns legal name, thai name, firm name, and category for a fund code
func (*Client) GetFundsByCategory ¶
GetFundsByCategory returns all fund codes in a given category
func (*Client) GetFundsByCompany ¶
GetFundsByCompany returns all fund codes for a given company/firm
func (*Client) GetFundsByCompanyFuzzy ¶
GetFundsByCompanyFuzzy returns fund codes for partial company name matches
func (*Client) GetMappings ¶
GetMappings returns the raw mappings (for advanced use)
func (*Client) NeedsUpdate ¶
NeedsUpdate checks if AIMC data needs to be updated based on last update timestamp Returns true if data is older than 90 days (quarterly) or has never been updated
type FundInfo ¶
type FundInfo struct {
LegalName string `json:"legal_name"`
ThaiName string `json:"thai_name"`
FirmName string `json:"firm_name"`
AIMCCategoryID string `json:"aimc_category_id,omitempty"`
AIMCCategory string `json:"-"` // Temporary field for parsing, not serialized
}
FundInfo represents AIMC data for a single fund
type Mappings ¶
type Mappings struct {
Categories map[string]string `json:"categories"`
Funds map[string]FundInfo `json:"funds"`
}
Mappings stores AIMC category and fund information
type MappingsWithMetadata ¶
type MappingsWithMetadata struct {
AIMCMappings
Metadata AIMCMetadata `json:"metadata"`
}
MappingsWithMetadata stores AIMC data with metadata