Documentation
¶
Index ¶
- Constants
- Variables
- func APIURL() string
- type API
- type APIOption
- type ErrorMessage
- type MysocketAPI
- func (a *MysocketAPI) AttachPolicies(ctx context.Context, socketID string, policyUUIDs []string) ([]string, error)
- func (a *MysocketAPI) CreateSocket(ctx context.Context, socket *models.Socket) (*models.Socket, error)
- func (a *MysocketAPI) CreateTunnel(ctx context.Context, socketID string) (*models.Tunnel, error)
- func (a *MysocketAPI) DeleteSocket(ctx context.Context, socketID string) error
- func (a *MysocketAPI) DetachPolicies(ctx context.Context, socketID string, policyUUIDs []string) ([]string, error)
- func (a *MysocketAPI) GetAccessToken() string
- func (a *MysocketAPI) GetOrganizationInfo(ctx context.Context) (*models.Organization, error)
- func (a *MysocketAPI) GetPoliciesBySocketID(socketID string) ([]models.Policy, error)
- func (a *MysocketAPI) GetPolicyByName(ctx context.Context, name string) (*models.Policy, error)
- func (a *MysocketAPI) GetSocket(ctx context.Context, socketID string) (*models.Socket, error)
- func (a *MysocketAPI) GetSockets(ctx context.Context) ([]models.Socket, error)
- func (a *MysocketAPI) GetTunnel(ctx context.Context, socketID string, tunnelID string) (*models.Tunnel, error)
- func (a *MysocketAPI) Login(email, password string) (*models.LoginResponse, error)
- func (a *MysocketAPI) Request(method string, url string, target interface{}, data interface{}, ...) error
- func (a *MysocketAPI) UpdateSocket(ctx context.Context, socketID string, socket models.Socket) error
- func (a *MysocketAPI) With(opt APIOption) *MysocketAPI
Constants ¶
View Source
const APIUrl = "https://api.border0.com/api/v1"
Variables ¶
View Source
var APIImpl = (*MysocketAPI)(nil)
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
Types ¶
type API ¶
type API interface { GetOrganizationInfo(ctx context.Context) (*models.Organization, error) GetSockets(ctx context.Context) ([]models.Socket, error) GetSocket(ctx context.Context, socketID string) (*models.Socket, error) GetTunnel(ctx context.Context, socketID string, tunnelID string) (*models.Tunnel, error) CreateTunnel(ctx context.Context, socketID string) (*models.Tunnel, error) CreateSocket(ctx context.Context, socket *models.Socket) (*models.Socket, error) UpdateSocket(ctx context.Context, socketID string, socket models.Socket) error DeleteSocket(ctx context.Context, socketID string) error Login(email, password string) (*models.LoginResponse, error) GetPolicyByName(ctx context.Context, name string) (*models.Policy, error) AttachPolicies(ctx context.Context, socketID string, policyUUIDs []string) ([]string, error) DetachPolicies(ctx context.Context, socketID string, policyUUIDs []string) ([]string, error) GetPoliciesBySocketID(socketID string) ([]models.Policy, error) GetAccessToken() string }
type ErrorMessage ¶
type ErrorMessage struct {
ErrorMessage string `json:"error_message,omitempty"`
}
type MysocketAPI ¶
func NewAPI ¶
func NewAPI(opts ...APIOption) *MysocketAPI
func (*MysocketAPI) AttachPolicies ¶
func (*MysocketAPI) CreateSocket ¶
func (*MysocketAPI) CreateTunnel ¶
func (*MysocketAPI) DeleteSocket ¶
func (a *MysocketAPI) DeleteSocket(ctx context.Context, socketID string) error
func (*MysocketAPI) DetachPolicies ¶
func (*MysocketAPI) GetAccessToken ¶
func (a *MysocketAPI) GetAccessToken() string
func (*MysocketAPI) GetOrganizationInfo ¶
func (a *MysocketAPI) GetOrganizationInfo(ctx context.Context) (*models.Organization, error)
func (*MysocketAPI) GetPoliciesBySocketID ¶
func (a *MysocketAPI) GetPoliciesBySocketID(socketID string) ([]models.Policy, error)
func (*MysocketAPI) GetPolicyByName ¶
func (*MysocketAPI) GetSockets ¶
func (*MysocketAPI) Login ¶
func (a *MysocketAPI) Login(email, password string) (*models.LoginResponse, error)
func (*MysocketAPI) Request ¶
func (a *MysocketAPI) Request(method string, url string, target interface{}, data interface{}, requireAccessToken bool) error
func (*MysocketAPI) UpdateSocket ¶
func (*MysocketAPI) With ¶
func (a *MysocketAPI) With(opt APIOption) *MysocketAPI
Click to show internal directories.
Click to hide internal directories.