# README
imagekit-go
A Go client library for accessing the ImageKit.io API.
Installation
Use the following command to download this module:
go get github.com/codedius/imagekit-go
Usage
import "github.com/codedius/imagekit-go"
Construct a new API client, then use to access the ImageKit.io API. For example:
opts := imagekit.Options{
PublicKey: "Your API Private Key",
PrivateKey: "Your API Public Key",
}
ik, err := imagekit.NewClient(&opts)
if err != nil {
// error handling
}
Upload image to your ImageKit.io Media Library:
ur := imagekit.UploadRequest{
File: file, // []byte OR *url.URL OR url.URL OR base64 string
FileName: "file name",
UseUniqueFileName: false,
Tags: []string{},
Folder: "/",
IsPrivateFile: false,
CustomCoordinates: "",
ResponseFields: nil,
}
ctx := context.Background()
upr, err := ik.Upload.ServerUpload(ctx, &ur)
if err != nil {
// error handling
}
Other methods are pretty straightforward and doesn't need extra explanations. For more info please read library's documentation from go.dev and ImageKit.io API documentation.
# Functions
NewClient returns a new API client.
# Structs
No description provided by the author
No description provided by the author
Client manages communication with the API.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ErrorResponse reports error caused by an API request.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Options contains all necessary data to make requests to the API.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
MediaService handles communication with the media related methods of the Imagekit.io API.
MetadataService handles communication with the metadata related methods of the ImageKit API.
UploadService handles communication with the upload related methods of the ImageKit API.