2024-05-12 09:21:20 -07:00
|
|
|
package apiclient
|
|
|
|
|
|
|
|
const (
|
|
|
|
HeaderContentType = "Content-Type"
|
|
|
|
MIMEApplicationForm = "application/x-www-form-urlencoded"
|
2024-05-12 10:46:00 -07:00
|
|
|
ApplicationJson = "application/json"
|
2024-05-12 09:21:20 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
type ApiClient struct {
|
2024-05-12 10:46:00 -07:00
|
|
|
Articles Articles
|
|
|
|
Users Users
|
2024-05-12 09:21:20 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
func New(serverAddress string) ApiClient {
|
|
|
|
return ApiClient{
|
2024-05-12 10:46:00 -07:00
|
|
|
Articles: newArticleService(serverAddress),
|
|
|
|
Users: newUserService(serverAddress),
|
2024-05-12 09:21:20 -07:00
|
|
|
}
|
|
|
|
}
|