All Projects → akamai → NetStorageKit-Golang

akamai / NetStorageKit-Golang

Licence: Apache-2.0 license
Netstorage API for Golang

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to NetStorageKit-Golang

NetStorageKit-Python
Akamai Netstorage API for Python
Stars: ✭ 22 (+29.41%)
Mutual labels:  akamai, akamai-open, netstorage, filestore, objectstore, akamai-netstorage, netstorage-api
terraform-provider-akamai
An Akamai GTM Terraform provider
Stars: ✭ 14 (-17.65%)
Mutual labels:  akamai
esi-test-server-docker
A dockerized version of Akamai's Edge Side Includes Test Server (ETS).
Stars: ✭ 30 (+76.47%)
Mutual labels:  akamai
AkamaiOPEN-edgegrid-ruby
This library implements the Akamai OPEN EdgeGrid Authentication scheme for the ruby net/http library.
Stars: ✭ 19 (+11.76%)
Mutual labels:  akamai
cli-property-manager
Use this Property Manager CLI to automate Akamai property changes and deployments across many environments.
Stars: ✭ 22 (+29.41%)
Mutual labels:  akamai
akamai-toolkit
A set of tools to work on Akamai v1 anti-bot solution. Current supported version: 1.70
Stars: ✭ 215 (+1164.71%)
Mutual labels:  akamai
akamai-collector
Akamai sensor data collector with API and database support!
Stars: ✭ 60 (+252.94%)
Mutual labels:  akamai
flipper
Feature Flipper, Feature Flags, Rollout Flags, Feature Toggles for Crystal
Stars: ✭ 21 (+23.53%)
Mutual labels:  filestore
AkamaiOPEN-edgegrid-C-Sharp
No description or website provided.
Stars: ✭ 13 (-23.53%)
Mutual labels:  akamai
cli-eaa
CLI for Enterprise Application Access (EAA)
Stars: ✭ 19 (+11.76%)
Mutual labels:  akamai
SSSG-Ninja
All-in-one tool for site shield security group management
Stars: ✭ 16 (-5.88%)
Mutual labels:  akamai
aem-akamai-replication-agent
How to create custom replication agents in AEM using Akamai as an example.
Stars: ✭ 33 (+94.12%)
Mutual labels:  akamai
terraform-provider-akamai
Terraform Akamai provider
Stars: ✭ 75 (+341.18%)
Mutual labels:  akamai
AkamaiOPEN-edgegrid-php-client
PHP client library for Akamai {OPEN} EdgeGrid Authentication scheme (based on Guzzle)
Stars: ✭ 38 (+123.53%)
Mutual labels:  akamai
wp-akamai
No description or website provided.
Stars: ✭ 21 (+23.53%)
Mutual labels:  akamai
cli-sandbox
Akamai CLI for Sandbox
Stars: ✭ 14 (-17.65%)
Mutual labels:  akamai
AkamaiOPEN-edgegrid-java
Java library for Akamai OPEN EdgeGrid Client Authentication
Stars: ✭ 37 (+117.65%)
Mutual labels:  akamai
File-Sharing-Bot
Telegram Bot to store Posts and Documents and it can Access by Special Links.
Stars: ✭ 867 (+5000%)
Mutual labels:  filestore
Zee5
Just a simple shit but no one knows
Stars: ✭ 29 (+70.59%)
Mutual labels:  akamai
detect-cloudflare-plus
True Sight Firefox extension.
Stars: ✭ 34 (+100%)
Mutual labels:  akamai

Build Status Go Report Card GoDoc License

NetstorageKit-Golang: Akamai Netstorage API for Go

NetstorageKit-Golang is Akamai Netstorage (File/Object Store) API for Go 1.4+.

Important

Akamai does not maintain or regulate this package. While it can be incorporated to assist you in API use, Akamai Technical Support will not offer assistance and Akamai cannot be held liable if issues arise from its use.

Installation

To install Netstorage API for Go:

$ go get github.com/akamai/netstoragekit-golang

Example

package main

import (
  "fmt"
  "github.com/akamai/netstoragekit-golang"
  "./secrets" // in the .gitignore file
)

func main() {
  nsHostname := "astin-nsu.akamaihd.net"
  nsKeyname  := "astinapi"
  nsKey := secrets.KEY // Don't expose nsKey on public repository.
  nsCpcode := "360949"

  ns := netstorage.NewNetstorage(nsHostname, nsKeyname, nsKey, false)

  localSource := "hello.txt"
  nsDestination := fmt.Sprintf("/%s/hello.txt", nsCpcode) // or "/%s/" is same. 

  res, body, err := ns.Upload(localSource, nsDestination)
  if err != nil {
      // Do something
  }

  if res.StatusCode == 200 {
      fmt.Printf(body)
  }
}

Methods

ns.Delete(netstoragePath)
ns.Dir(netstoragePath)
ns.Download(netstorageSource, localDestintation)
ns.Du(netstoragePath)
ns.Mkdir(netstoragePath + newDirectory)
ns.Mtime(netstoragePath, mTime) // ex) mTime: time.Now().Unix()
ns.QuickDelete(netstorageDir) // needs to the privilege on the CP Code
ns.Rename(netstorageTarget, netstorageDestination)
ns.Rmdir(netstorageDir) // remove empty direcoty
ns.Stat(netstoragePath)
ns.Symlink(netstorageTarget, netstorageDestination)
ns.Upload(localSource, netstorageDestination)

// INFO: can "Upload" Only a single file, not directory.

Test

You can test all above methods with the unittest script (NOTE: You should input nsHostname, nsKeyname, nsKey and nsCpcode in the script):

$ go test
### Netstorage Test ###
[TEST] Dir /360949 done
[TEST] Mkdir /360949/nst_1477474457 done
[TEST] Upload nst_1477474457.txt to /360949/nst_1477474457/nst_1477474457.txt done
[TEST] Du /360949/nst_1477474457 done
[TEST] Mtime /360949/nst_1477474457/nst_1477474457.txt done
[TEST] Stat /360949/nst_1477474457/nst_1477474457.txt done
[TEST] Symlink /360949/nst_1477474457/nst_1477474457.txt to /360949/nst_1477474457/nst_1477474457.txt_lnk done
[TEST] Rename /360949/nst_1477474457/nst_1477474457.txt to /360949/nst_1477474457/nst_1477474457.txt_rename done
[TEST] Download /360949/nst_1477474457/nst_1477474457.txt done
[TEST] delete /360949/nst_1477474457/nst_1477474457.txt_rename done
[TEST] delete /360949/nst_1477474457/nst_1477474457.txt_lnk done
[TEST] rmdir /360949/nst_1477474457 done

### Error Test ###
[TEST] Dir: netstorage invalid path test done
[TEST] Upload: local invalid path test done
[TEST] Download: netstorage directory path test done

PASS
[TEARDOWN] remove nst_1477474457.txt from local done
[TEARDOWN] remove nst_1477474457.txt_rename from local done
ok  	github.com/akamai/netstoragekit-golang	x.xxxs

Author

Astin Choi ([email protected])

License

Copyright 2016 Akamai Technologies, Inc. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].