company

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package company provides functionality for interacting with company data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GeneralSearch

type GeneralSearch []struct {
	Symbol            string `json:"symbol"`
	Name              string `json:"name"`
	Currency          string `json:"currency"`
	StockExchange     string `json:"stockExchange"`
	ExchangeShortName string `json:"exchangeShortName"`
}

GeneralSearch represents the response structure for a general search query. @see https://site.financialmodelingprep.com/developer/docs/stock-ticker-symbol-lookup-api

type NameSearch

type NameSearch []struct {
	Symbol            string `json:"symbol"`
	Name              string `json:"name"`
	Currency          string `json:"currency"`
	StockExchange     string `json:"stockExchange"`
	ExchangeShortName string `json:"exchangeShortName"`
}

NameSearch represents the response structure for a search by name query. @see https://site.financialmodelingprep.com/developer/docs/name-search-company-search

type Query

type Query struct {
	Query    string
	Limit    string
	Exchange string
	APIKey   string
}

Query represents a query object used for Search interface.

func (*Query) GetURL

func (query *Query) GetURL(uri string) string

GetURL constructs the URL for the company search based on the provided URI and query parameters.

type Repository

type Repository struct {
	HTTPClient api.ClientInterface
}

Repository represents a repository for interacting with API company search endpoints

func (*Repository) Search

func (repository *Repository) Search(query Query) (*GeneralSearch, error)

Search performs a search for companies based on the provided query data.

func (*Repository) SearchByName

func (repository *Repository) SearchByName(query Query) (*NameSearch, error)

SearchByName performs a search for a company based on the provided ticker symbol.

func (*Repository) SearchByTicker

func (repository *Repository) SearchByTicker(query Query) (*TickerSearch, error)

SearchByTicker performs a search for a company based on the provided ticker symbol.

type Search interface {
	GeneralSearch | TickerSearch | NameSearch
}

Search interface for a common response structures Symbol: represents the symbol of the company. Name: represents the name of the company. Currency: represents the currency that use the company. StockExchange: represents the company stock exchange. ExchangeShortName: represents the short name of the company exchange.

type TickerSearch

type TickerSearch []struct {
	Symbol            string `json:"symbol"`
	Name              string `json:"name"`
	Currency          string `json:"currency"`
	StockExchange     string `json:"stockExchange"`
	ExchangeShortName string `json:"exchangeShortName"`
}

TickerSearch represents the response structure for a search by ticker query. @see https://site.financialmodelingprep.com/developer/docs/ticker-search-company-search

Jump to

Keyboard shortcuts

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