Documentation
¶
Index ¶
- Constants
- Variables
- type APIError
- type Client
- func (client *Client) AddResourceGroups(ctx context.Context, resource *model.Resource) error
- func (client *Client) AddResourceServiceAccountIDs(ctx context.Context, resource *model.Resource) error
- func (client *Client) CreateConnector(ctx context.Context, remoteNetworkID, connectorName string) (*model.Connector, error)
- func (client *Client) CreateGroup(ctx context.Context, groupName string) (*model.Group, error)
- func (client *Client) CreateRemoteNetwork(ctx context.Context, req *model.RemoteNetwork) (*model.RemoteNetwork, error)
- func (client *Client) CreateResource(ctx context.Context, input *model.Resource) (*model.Resource, error)
- func (client *Client) CreateServiceAccount(ctx context.Context, serviceAccountName string) (*model.ServiceAccount, error)
- func (client *Client) CreateServiceKey(ctx context.Context, serviceAccountKey *model.ServiceKey) (*model.ServiceKey, error)
- func (client *Client) DeleteConnector(ctx context.Context, connectorID string) error
- func (client *Client) DeleteGroup(ctx context.Context, groupID string) error
- func (client *Client) DeleteRemoteNetwork(ctx context.Context, remoteNetworkID string) error
- func (client *Client) DeleteResource(ctx context.Context, resourceID string) error
- func (client *Client) DeleteResourceGroups(ctx context.Context, resourceID string, deleteGroupIDs []string) error
- func (client *Client) DeleteResourceServiceAccounts(ctx context.Context, resourceID string, deleteServiceAccountIDs []string) error
- func (client *Client) DeleteServiceAccount(ctx context.Context, serviceAccountID string) error
- func (client *Client) DeleteServiceKey(ctx context.Context, serviceAccountKeyID string) error
- func (client *Client) GenerateConnectorTokens(ctx context.Context, connectorID string) (*model.ConnectorTokens, error)
- func (client *Client) ReadConnector(ctx context.Context, connectorID string) (*model.Connector, error)
- func (client *Client) ReadConnectors(ctx context.Context) ([]*model.Connector, error)
- func (client *Client) ReadGroup(ctx context.Context, groupID string) (*model.Group, error)
- func (client *Client) ReadGroups(ctx context.Context, filter *model.GroupsFilter) ([]*model.Group, error)
- func (client *Client) ReadRemoteNetwork(ctx context.Context, remoteNetworkID, remoteNetworkName string) (*model.RemoteNetwork, error)
- func (client *Client) ReadRemoteNetworkByID(ctx context.Context, remoteNetworkID string) (*model.RemoteNetwork, error)
- func (client *Client) ReadRemoteNetworkByName(ctx context.Context, remoteNetworkName string) (*model.RemoteNetwork, error)
- func (client *Client) ReadRemoteNetworks(ctx context.Context) ([]*model.RemoteNetwork, error)
- func (client *Client) ReadResource(ctx context.Context, resourceID string) (*model.Resource, error)
- func (client *Client) ReadResourceServiceAccounts(ctx context.Context, resourceID string) ([]string, error)
- func (client *Client) ReadResources(ctx context.Context) ([]*model.Resource, error)
- func (client *Client) ReadResourcesByName(ctx context.Context, name string) ([]*model.Resource, error)
- func (client *Client) ReadSecurityPolicies(ctx context.Context) ([]*model.SecurityPolicy, error)
- func (client *Client) ReadSecurityPolicy(ctx context.Context, securityPolicyID, securityPolicyName string) (*model.SecurityPolicy, error)
- func (client *Client) ReadServiceAccount(ctx context.Context, serviceAccountID string) (*model.ServiceAccount, error)
- func (client *Client) ReadServiceAccounts(ctx context.Context, input ...string) ([]*model.ServiceAccount, error)
- func (client *Client) ReadServiceKey(ctx context.Context, serviceAccountKeyID string) (*model.ServiceKey, error)
- func (client *Client) ReadShallowServiceAccount(ctx context.Context, serviceAccountID string) (*model.ServiceAccount, error)
- func (client *Client) ReadShallowServiceAccounts(ctx context.Context) ([]*model.ServiceAccount, error)
- func (client *Client) ReadUser(ctx context.Context, userID string) (*model.User, error)
- func (client *Client) ReadUsers(ctx context.Context) ([]*model.User, error)
- func (client *Client) RevokeServiceKey(ctx context.Context, serviceAccountKeyID string) error
- func (client *Client) UpdateConnector(ctx context.Context, connectorID string, connectorName string) (*model.Connector, error)
- func (client *Client) UpdateGroup(ctx context.Context, groupID, groupName string) (*model.Group, error)
- func (client *Client) UpdateRemoteNetwork(ctx context.Context, req *model.RemoteNetwork) (*model.RemoteNetwork, error)
- func (client *Client) UpdateResource(ctx context.Context, input *model.Resource) (*model.Resource, error)
- func (client *Client) UpdateResourceActiveState(ctx context.Context, resource *model.Resource) error
- func (client *Client) UpdateServiceAccount(ctx context.Context, serviceAccount *model.ServiceAccount) (*model.ServiceAccount, error)
- func (client *Client) UpdateServiceAccountRemoveResources(ctx context.Context, serviceAccountID string, resourceIDsToRemove []string) error
- func (client *Client) UpdateServiceKey(ctx context.Context, serviceAccountKey *model.ServiceKey) (*model.ServiceKey, error)
- func (client *Client) VerifyConnectorTokens(ctx context.Context, refreshToken, accessToken string) error
- type HTTPError
- type MutationError
- type PageInfo
- type PortRangeInput
- type ProtocolInput
- type ProtocolsInput
- type RemoteNetworkLocation
Constants ¶
View Source
const (
EnvAPIToken = "TWINGATE_API_TOKEN" //#nosec
)
Variables ¶
View Source
var ( ErrTooManyGroupsError = fmt.Errorf("provider does not support more than %d groups per resource", readResourceQueryGroupsSize) ErrGraphqlIDIsEmpty = errors.New("id is empty") ErrGraphqlNameIsEmpty = errors.New("name is empty") ErrGraphqlEmptyBothNameAndID = errors.New("both name and id should not be empty") ErrGraphqlResourceNotFound = errors.New("not found") ErrGraphqlResultIsEmpty = errors.New("query result is empty") ErrGraphqlConnectorIDIsEmpty = errors.New("connector id is empty") ErrGraphqlNetworkIDIsEmpty = errors.New("network id is empty") ErrGraphqlNetworkNameIsEmpty = errors.New("network name is empty") ErrGraphqlGroupNameIsEmpty = errors.New("group name is empty") )
View Source
var ErrAPITokenNoSet = errors.New("api_token not set")
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct { WrappedError error Operation string Resource string ID graphql.ID Name string }
func NewAPIError ¶
func NewAPIErrorWithID ¶
func NewAPIErrorWithName ¶
type Client ¶
type Client struct { GraphqlClient *graphql.Client HTTPClient *http.Client GraphqlServerURL string APIServerURL string // contains filtered or unexported fields }
func (*Client) AddResourceGroups ¶ added in v0.3.0
func (*Client) AddResourceServiceAccountIDs ¶ added in v0.3.0
func (*Client) CreateConnector ¶
func (*Client) CreateGroup ¶
func (*Client) CreateRemoteNetwork ¶
func (client *Client) CreateRemoteNetwork(ctx context.Context, req *model.RemoteNetwork) (*model.RemoteNetwork, error)
func (*Client) CreateResource ¶
func (*Client) CreateServiceAccount ¶
func (*Client) CreateServiceKey ¶
func (client *Client) CreateServiceKey(ctx context.Context, serviceAccountKey *model.ServiceKey) (*model.ServiceKey, error)
func (*Client) DeleteConnector ¶
func (*Client) DeleteGroup ¶
func (*Client) DeleteRemoteNetwork ¶
func (*Client) DeleteResource ¶
func (*Client) DeleteResourceGroups ¶ added in v0.3.0
func (*Client) DeleteResourceServiceAccounts ¶ added in v0.3.0
func (*Client) DeleteServiceAccount ¶
func (*Client) DeleteServiceKey ¶
func (*Client) GenerateConnectorTokens ¶
func (*Client) ReadConnector ¶
func (*Client) ReadConnectors ¶
func (*Client) ReadGroups ¶
func (*Client) ReadRemoteNetwork ¶
func (*Client) ReadRemoteNetworkByID ¶
func (*Client) ReadRemoteNetworkByName ¶
func (*Client) ReadRemoteNetworks ¶
func (*Client) ReadResource ¶
func (*Client) ReadResourceServiceAccounts ¶ added in v0.3.0
func (*Client) ReadResources ¶
func (*Client) ReadResourcesByName ¶
func (*Client) ReadSecurityPolicies ¶ added in v0.2.4
func (*Client) ReadSecurityPolicy ¶ added in v0.2.4
func (*Client) ReadServiceAccount ¶
func (*Client) ReadServiceAccounts ¶
func (*Client) ReadServiceKey ¶
func (*Client) ReadShallowServiceAccount ¶ added in v0.2.4
func (*Client) ReadShallowServiceAccounts ¶ added in v0.2.4
func (*Client) RevokeServiceKey ¶
func (*Client) UpdateConnector ¶
func (*Client) UpdateGroup ¶
func (*Client) UpdateRemoteNetwork ¶
func (client *Client) UpdateRemoteNetwork(ctx context.Context, req *model.RemoteNetwork) (*model.RemoteNetwork, error)
func (*Client) UpdateResource ¶
func (*Client) UpdateResourceActiveState ¶
func (*Client) UpdateServiceAccount ¶
func (client *Client) UpdateServiceAccount(ctx context.Context, serviceAccount *model.ServiceAccount) (*model.ServiceAccount, error)
func (*Client) UpdateServiceAccountRemoveResources ¶ added in v0.3.0
func (*Client) UpdateServiceKey ¶
func (client *Client) UpdateServiceKey(ctx context.Context, serviceAccountKey *model.ServiceKey) (*model.ServiceKey, error)
type MutationError ¶
type MutationError struct {
Message graphql.String
}
func NewMutationError ¶
func NewMutationError(message graphql.String) *MutationError
func (*MutationError) Error ¶
func (e *MutationError) Error() string
type PortRangeInput ¶
type PortRangeInput struct { Start graphql.Int `json:"start"` End graphql.Int `json:"end"` }
type ProtocolInput ¶
type ProtocolInput struct { Ports []*PortRangeInput `json:"ports"` Policy graphql.String `json:"policy"` }
type ProtocolsInput ¶
type ProtocolsInput struct { UDP *ProtocolInput `json:"udp"` TCP *ProtocolInput `json:"tcp"` AllowIcmp graphql.Boolean `json:"allowIcmp"` }
type RemoteNetworkLocation ¶
type RemoteNetworkLocation graphql.String
Source Files
¶
Click to show internal directories.
Click to hide internal directories.