Documentation
¶
Index ¶
- Constants
- Variables
- func TranslateFee(fee *models.Fee, useEnglish bool)
- type Client
- func (c *Client) GetFundDividend(fundID string) (*models.FundDividend, error)
- func (c *Client) GetFundFee(fundID string) (*models.FundFee, error)
- func (c *Client) GetFundLatest(fundID string) (*models.FundLatest, error)
- func (c *Client) GetFundOverview(fundID string) (*models.FundOverview, error)
- func (c *Client) GetFundPerformance(fundID string) (*models.FundPerformance, error)
- func (c *Client) GetFundPortfolio(fundID string) (*models.FundPortfolio, error)
- func (c *Client) GetFundVerify(fundID string) (*models.FundVerify, error)
- func (c *Client) GetFundsList() ([]models.Fund, error)
- func (c *Client) GetHistoricalPrices(symbol, resolution string, from, to time.Time) (*models.BarsResponse, error)
- func (c *Client) GetRelatedFunds(categoryID, period string, excludeFundIDs []string, limit int) (*models.RelatedFundsData, error)
- func (c *Client) GetServerTime() (int64, error)
- func (c *Client) GetSymbolInfo(symbol string) (*models.SymbolInfo, error)
- func (c *Client) SearchFund(query string) (*models.Fund, error)
- func (c *Client) SetRetryConfig(maxRetries int, retryDelay time.Duration)
Constants ¶
const ( BaseURL = "https://www.finnomena.com/fn3/api/fund/v2/public" // Default retry configuration DefaultMaxRetries = 3 DefaultRetryDelay = 1 * time.Second RetryBackoffMultiplier = 2 )
Variables ¶
var FeeDescriptionTranslation = map[string]string{
"ค่าใช้จ่ายอื่นๆ": "other fee",
"ค่าธรรมเนียมการขายหน่วยลงทุน (Front-end Fee)": "purchase fee",
"ค่าธรรมเนียมการจัดการ": "management fee",
"ค่าธรรมเนียมการรับซื้อคืนหน่วยลงทุน (Back-end Fee)": "redemption fee",
"ค่าธรรมเนียมการสับเปลี่ยนหน่วยลงทุนเข้า (SWITCHING IN)": "switch in fee",
"ค่าธรรมเนียมการสับเปลี่ยนหน่วยลงทุนออก (SWITCHING OUT)": "switch out fee",
"ค่าธรรมเนียมและค่าใช้จ่ายรวมทั้งหมด": "total expense ratio",
"ค่าธรรมเนียมการโอนหน่วยลงทุน": "unit transfer fee",
"ค่าธรรมเนียมนายทะเบียนหน่วย": "registrar fee",
"ค่าธรรมเนียมผู้ดูแลผลประโยชน์": "trustee fee",
}
var FeeOtherDescTranslation = map[string]string{
"บริษัทจัดการอาจเรียกเก็บค่าธรรมเนียมการขายและค่าธรรมเนียมการรับซื้อคืนกับผู้ลงทุนแต่ละกลุ่มไม่เท่ากัน ทั้งนี้ ผู้ลงทุนสามารถดูรายละเอียดเพิ่มเติมได้ที่หนังสือชี้ชวนส่วนข้อมูลกองทุนรวม": "The fund management company may charge different sales fees and redemption fees to different investor groups. Investors can find more details in the fund information section of the prospectus.",
"บริษัทจัดการอาจพิจารณาเปลี่ยนแปลงค่าธรรมเนียมที่เรียกเก็บจริงเพื่อให้สอดคล้องกับกลยุทธ์หรือค่าใช้จ่ายในการบริหารจัดการ และรวมค่าใช้จ่ายเป็นข้อมูลของรอบปีบัญชีล่าสุดหรือประมาณการเบื้องต้น (กรณียังไม่ครบรอบปีบัญชี)": "The management company may consider adjusting the actual fees charged to align with its strategy or management expenses, and include these expenses in the data for the latest accounting year or a preliminary estimate (if the accounting year has not yet ended).",
}
var FeeUnitTranslation = map[string]string{
"ต่อปี ของมูลค่าทรัพย์สินสุทธิของกองทุน": "per year of NAV",
"% ต่อปี": "% per year",
"บาท": "baht",
}
Functions ¶
func TranslateFee ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents the Finnomena API client
func NewClientWithRetry ¶
NewClientWithRetry creates a new Finnomena API client with custom retry configuration
func NewClientWithTimeout ¶
NewClientWithTimeout creates a new Finnomena API client with custom timeout
func (*Client) GetFundDividend ¶ added in v1.2.0
func (c *Client) GetFundDividend(fundID string) (*models.FundDividend, error)
GetFundDividend retrieves dividend information for a specific fund
func (*Client) GetFundFee ¶
GetFundFee retrieves fee information for a specific fund
func (*Client) GetFundLatest ¶
func (c *Client) GetFundLatest(fundID string) (*models.FundLatest, error)
GetFundLatest retrieves the latest data for a specific fund
func (*Client) GetFundOverview ¶
func (c *Client) GetFundOverview(fundID string) (*models.FundOverview, error)
GetFundOverview retrieves overview data for a specific fund
func (*Client) GetFundPerformance ¶
func (c *Client) GetFundPerformance(fundID string) (*models.FundPerformance, error)
GetFundPerformance retrieves performance data for a specific fund
func (*Client) GetFundPortfolio ¶
func (c *Client) GetFundPortfolio(fundID string) (*models.FundPortfolio, error)
func (*Client) GetFundVerify ¶
func (c *Client) GetFundVerify(fundID string) (*models.FundVerify, error)
GetFundVerify retrieves verification data including available periods for a fund
func (*Client) GetFundsList ¶
GetFundsList retrieves the list of all available funds
func (*Client) GetHistoricalPrices ¶
func (c *Client) GetHistoricalPrices(symbol, resolution string, from, to time.Time) (*models.BarsResponse, error)
GetHistoricalPrices retrieves historical OHLCV bars for a fund
func (*Client) GetRelatedFunds ¶ added in v1.2.0
func (c *Client) GetRelatedFunds(categoryID, period string, excludeFundIDs []string, limit int) (*models.RelatedFundsData, error)
GetRelatedFunds retrieves related funds for a specific category
func (*Client) GetServerTime ¶
GetServerTime retrieves the server time from the API
func (*Client) GetSymbolInfo ¶
func (c *Client) GetSymbolInfo(symbol string) (*models.SymbolInfo, error)
GetSymbolInfo retrieves symbol information for a specific fund
func (*Client) SearchFund ¶
SearchFund searches for a fund by short code or name