2019-04-03 09:46:21 +01:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package uplink
|
|
|
|
|
|
|
|
// APIKey represents an access credential to certain resources
|
|
|
|
type APIKey struct {
|
|
|
|
key string
|
|
|
|
}
|
|
|
|
|
2019-05-14 19:15:12 +01:00
|
|
|
// Serialize serializes the API key to a string
|
2019-04-03 09:46:21 +01:00
|
|
|
func (a APIKey) Serialize() string {
|
|
|
|
return a.key
|
|
|
|
}
|
|
|
|
|
2019-05-14 19:15:12 +01:00
|
|
|
// ParseAPIKey parses an API key
|
2019-04-03 09:46:21 +01:00
|
|
|
func ParseAPIKey(val string) (APIKey, error) {
|
|
|
|
return APIKey{key: val}, nil
|
|
|
|
}
|