Documentation
¶
Index ¶
- type ApiDecoratorService
- func (service *ApiDecoratorService) Apply(api interface{}) interface{}
- func (service *ApiDecoratorService) ApplyToMethod(method func(args ...interface{}) (interface{}, error)) func(args ...interface{}) (interface{}, error)
- func (service *ApiDecoratorService) SetDecorators(decorators []decorator.IDecorator)
- type AuthMethod
- type AuthType
- type Client
- type Headers
- type IAPIType
- type ICollectionType
- type IForwardPaging
- type INextPage
- type IRequestContext
- type MockAPI
- type Options
- type Request
- type RequestContext
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiDecoratorService ¶
type ApiDecoratorService struct {
// contains filtered or unexported fields
}
ApiDecoratorService is a singleton service for managing and applying decorators
func GetInstance ¶
func GetInstance() *ApiDecoratorService
GetInstance returns the singleton instance of ApiDecoratorService
func (*ApiDecoratorService) Apply ¶
func (service *ApiDecoratorService) Apply(api interface{}) interface{}
Apply applies decorators to all methods of an API
func (*ApiDecoratorService) ApplyToMethod ¶
func (service *ApiDecoratorService) ApplyToMethod(method func(args ...interface{}) (interface{}, error)) func(args ...interface{}) (interface{}, error)
ApplyToMethod applies decorators to a single method
func (*ApiDecoratorService) SetDecorators ¶
func (service *ApiDecoratorService) SetDecorators(decorators []decorator.IDecorator)
SetDecorators sets the decorators for the service
type AuthMethod ¶
type AuthMethod string
const ( HapiKey AuthMethod = "hapikey" AccessToken AuthMethod = "accessToken" )
type Client ¶
type Client struct{}
Client struct for HTTP client
func NewHttpClient ¶
func NewHttpClient() *Client
NewHttpClient initializes and returns a new Client instance
func (*Client) SendAdapter ¶
SendAdapter wraps Send to match the generalized IDecorator signature
type IAPIType ¶
type IAPIType interface {
GetPage(limit int, after string, properties []string, propertiesWithHistory []string, associations []string, archived bool) (ICollectionType, error)
}
IAPIType defines an interface for API interactions
type ICollectionType ¶
type ICollectionType struct {
Results []interface{}
Paging *IForwardPaging
}
ICollectionType represents a collection type with results and paging
type IForwardPaging ¶
type IForwardPaging struct {
Next *INextPage
}
IForwardPaging represents forward paging information
type INextPage ¶
type INextPage struct {
After string
}
INextPage represents the next page in pagination
type IRequestContext ¶
type IRequestContext interface {
SetHeaderParam(key, value string)
SetAgent(agent *http.Transport)
}
IRequestContext defines the interface for setting header parameters and agents
type Options ¶
type Options struct {
Method string
Path string
OverlapUrl string
QS map[string]string
Headers Headers
Body interface{}
DefaultJSON bool
}
Options IHttpOptions struct for HTTP options
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request struct for HTTP request
func NewHttpRequest ¶
func NewHttpRequest(config configuration.Configuration, opts Options) (*Request, error)
NewHttpRequest NewRequest initializes a new request
type RequestContext ¶
type RequestContext struct {
// contains filtered or unexported fields
}
RequestContext implements the IRequestContext interface
func NewRequestContext ¶
func NewRequestContext() *RequestContext
NewRequestContext creates a new instance of RequestContext