Skip to content

Commit

Permalink
pkg/endpoint: Deprecated by github.com/beyondstorage/go-endpoint (#595)
Browse files Browse the repository at this point in the history
Signed-off-by: Xuanwo <[email protected]>
  • Loading branch information
Xuanwo authored Jun 9, 2021
1 parent 6894daf commit 2d76235
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/endpoint/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@ import (

const (
// ProtocolHTTPS is the https credential protocol.
//
// Deprecated: Moved to github.com/beyondstorage/go-endpoint
ProtocolHTTPS = "https"
// ProtocolHTTP is the http credential protocol.
//
// Deprecated: Moved to github.com/beyondstorage/go-endpoint
ProtocolHTTP = "http"
)

// Value is the required info to connect a service.
//
// Deprecated: Moved to github.com/beyondstorage/go-endpoint
type Value struct {
Protocol string
Host string
Expand All @@ -29,6 +35,8 @@ func (v Value) String() string {
}

// Parse will parse config string to create a endpoint Provider.
//
// Deprecated: Moved to github.com/beyondstorage/go-endpoint
func Parse(cfg string) (p Value, err error) {
s := strings.Split(cfg, ":")
if len(s) < 2 {
Expand Down Expand Up @@ -67,6 +75,8 @@ func Parse(cfg string) (p Value, err error) {
}

// NewHTTPS will create a static endpoint from parsed URL.
//
// Deprecated: Moved to github.com/beyondstorage/go-endpoint
func NewHTTPS(host string, port int) Value {
return Value{
Protocol: ProtocolHTTPS,
Expand All @@ -76,6 +86,8 @@ func NewHTTPS(host string, port int) Value {
}

// NewHTTP will create a static endpoint from parsed URL.
//
// Deprecated: Moved to github.com/beyondstorage/go-endpoint
func NewHTTP(host string, port int) Value {
return Value{
Protocol: ProtocolHTTP,
Expand Down
6 changes: 6 additions & 0 deletions pkg/endpoint/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ import (

var (
// ErrUnsupportedProtocol will return if protocol is unsupported.
//
// Deprecated: Moved to github.com/beyondstorage/go-endpoint
ErrUnsupportedProtocol = errors.New("unsupported protocol")
// ErrInvalidValue means value is invalid.
//
// Deprecated: Moved to github.com/beyondstorage/go-endpoint
ErrInvalidValue = errors.New("invalid value")
)

// Error represents error related to endpoint.
//
// Deprecated: Moved to github.com/beyondstorage/go-endpoint
type Error struct {
Op string
Err error
Expand Down

0 comments on commit 2d76235

Please sign in to comment.