Documentation ¶
Index ¶
- Variables
- func CreatePeerInputToCreateOptions(input CreatePeerInput) *peer.CreateOptions
- func CreateServerInputToCreateServerOptions(input CreateServerInput) (_ *server.CreateOptions, err error)
- func CreateUserInputToUserCreateUserOptions(createUserInput CreateUserInput) *user.CreateOptions
- func MarshalDateTime(t time.Time) graphql.Marshaler
- func PeerHookInputToPeerHook(hook *PeerHookInput) *peer.Hook
- func ServerHookInputToServerHook(hook *ServerHookInput) *server.Hook
- func UnmarshalDateTime(v interface{}) (time.Time, error)
- func UpdatePeerInputToUpdatePeerOptionsAndUpdatePeerFieldMask(input UpdatePeerInput) (options *peer.UpdateOptions, fieldMask *peer.UpdateFieldMask)
- func UpdateServerInputToUpdateOptionsAndUpdateFieldMask(input UpdateServerInput) (options *server.UpdateOptions, fieldMask *server.UpdateFieldMask, err error)
- func UpdateUserInputToUserUpdateUserOptions(input UpdateUserInput) (*user.UpdateOptions, *user.UpdateFieldMask, error)
- func UserToContext(ctx context.Context, user *User, err error) context.Context
- type CreatePeerInput
- type CreatePeerPayload
- type CreateServerInput
- type CreateServerPayload
- type CreateUserInput
- type CreateUserPayload
- type DeletePeerInput
- type DeletePeerPayload
- type DeleteServerInput
- type DeleteServerPayload
- type DeleteUserInput
- type DeleteUserPayload
- type ForeignInterface
- type ForeignPeer
- type ForeignServer
- type GenerateWireguardKeyInput
- type GenerateWireguardKeyPayload
- type ID
- type IdKind
- type ImportForeignServerInput
- type ImportForeignServerPayload
- type Mutation
- type Node
- type NodeChangedEvent
- type Peer
- type PeerChangedEvent
- type PeerHook
- type PeerHookInput
- type PeerStats
- type Query
- type Server
- type ServerChangedEvent
- type ServerHook
- type ServerHookInput
- type ServerInterfaceStats
- type SignInInput
- type SignInPayload
- type StartServerInput
- type StartServerPayload
- type StopServerInput
- type StopServerPayload
- type Subscription
- type UpdatePeerInput
- type UpdatePeerPayload
- type UpdateServerInput
- type UpdateServerPayload
- type UpdateUserInput
- type UpdateUserPayload
- type User
- type UserChangedEvent
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrIDNotString = errors.New("ID is not a string")
View Source
var (
ErrUserNotFound = errors.New("user not found")
)
Functions ¶
func CreatePeerInputToCreateOptions ¶
func CreatePeerInputToCreateOptions(input CreatePeerInput) *peer.CreateOptions
func CreateServerInputToCreateServerOptions ¶
func CreateServerInputToCreateServerOptions(input CreateServerInput) (_ *server.CreateOptions, err error)
func CreateUserInputToUserCreateUserOptions ¶
func CreateUserInputToUserCreateUserOptions(createUserInput CreateUserInput) *user.CreateOptions
func PeerHookInputToPeerHook ¶
func PeerHookInputToPeerHook(hook *PeerHookInput) *peer.Hook
func ServerHookInputToServerHook ¶
func ServerHookInputToServerHook(hook *ServerHookInput) *server.Hook
func UnmarshalDateTime ¶
func UpdatePeerInputToUpdatePeerOptionsAndUpdatePeerFieldMask ¶
func UpdatePeerInputToUpdatePeerOptionsAndUpdatePeerFieldMask(input UpdatePeerInput) (options *peer.UpdateOptions, fieldMask *peer.UpdateFieldMask)
func UpdateServerInputToUpdateOptionsAndUpdateFieldMask ¶
func UpdateServerInputToUpdateOptionsAndUpdateFieldMask(input UpdateServerInput) (options *server.UpdateOptions, fieldMask *server.UpdateFieldMask, err error)
func UpdateUserInputToUserUpdateUserOptions ¶
func UpdateUserInputToUserUpdateUserOptions(input UpdateUserInput) (*user.UpdateOptions, *user.UpdateFieldMask, error)
Types ¶
type CreatePeerInput ¶
type CreatePeerInput struct { ClientMutationID graphql.Omittable[*string] `json:"clientMutationId,omitempty"` ServerID ID `json:"serverId"` Name string `json:"name"` Description graphql.Omittable[*string] `json:"description,omitempty"` PublicKey string `json:"publicKey"` AllowedIPs []string `json:"allowedIPs"` Endpoint graphql.Omittable[*string] `json:"endpoint,omitempty"` PersistentKeepalive graphql.Omittable[*int] `json:"persistentKeepalive,omitempty"` Hooks graphql.Omittable[[]*PeerHookInput] `json:"hooks,omitempty"` }
type CreatePeerPayload ¶
type CreateServerInput ¶
type CreateServerInput struct { ClientMutationID graphql.Omittable[*string] `json:"clientMutationId,omitempty"` Name string `json:"name"` Description graphql.Omittable[*string] `json:"description,omitempty"` Enabled graphql.Omittable[*bool] `json:"enabled,omitempty"` PrivateKey graphql.Omittable[*string] `json:"privateKey,omitempty"` PublicKey graphql.Omittable[*string] `json:"publicKey,omitempty"` ListenPort graphql.Omittable[*int] `json:"listenPort,omitempty"` FirewallMark graphql.Omittable[*int] `json:"firewallMark,omitempty"` Address string `json:"address"` DNS graphql.Omittable[[]string] `json:"dns,omitempty"` Mtu graphql.Omittable[*int] `json:"mtu,omitempty"` Hooks graphql.Omittable[[]*ServerHookInput] `json:"hooks,omitempty"` }
type CreateServerPayload ¶
type CreateUserInput ¶
type CreateUserPayload ¶
type DeletePeerInput ¶
type DeletePeerPayload ¶
type DeleteServerInput ¶
type DeleteServerPayload ¶
type DeleteUserInput ¶
type DeleteUserPayload ¶
type ForeignInterface ¶
type ForeignInterface struct { Name string `json:"name"` Addresses []string `json:"addresses"` Mtu int `json:"mtu"` }
func ToForeignInterface ¶
func ToForeignInterface(foreignInterface *backend.ForeignInterface) *ForeignInterface
type ForeignPeer ¶
type ForeignPeer struct { PublicKey string `json:"publicKey"` Endpoint *string `json:"endpoint,omitempty"` AllowedIps []string `json:"allowedIps,omitempty"` PersistentKeepAliveInterval int `json:"persistentKeepAliveInterval"` LastHandshakeTime *time.Time `json:"lastHandshakeTime,omitempty"` ReceiveBytes float64 `json:"receiveBytes"` TransmitBytes float64 `json:"transmitBytes"` ProtocolVersion int `json:"protocolVersion"` }
func ToForeignPeer ¶
func ToForeignPeer(foreignPeer *backend.Peer) *ForeignPeer
type ForeignServer ¶
type ForeignServer struct { ForeignInterface *ForeignInterface `json:"foreignInterface"` Name string `json:"name"` Type string `json:"type"` PublicKey string `json:"publicKey"` ListenPort int `json:"listenPort"` FirewallMark int `json:"firewallMark"` Peers []*ForeignPeer `json:"peers"` }
func ToForeignServer ¶
func ToForeignServer(foreignServer *backend.ForeignServer) *ForeignServer
type NodeChangedEvent ¶
type NodeChangedEvent interface {
IsNodeChangedEvent()
}
type Peer ¶
type Peer struct { ID ID `json:"id"` Server *Server `json:"server"` Name string `json:"name"` Description string `json:"description"` PublicKey string `json:"publicKey"` AllowedIPs []string `json:"allowedIPs,omitempty"` Endpoint string `json:"endpoint"` PersistentKeepalive *int `json:"persistentKeepalive,omitempty"` Hooks []*PeerHook `json:"hooks,omitempty"` Stats *PeerStats `json:"stats,omitempty"` CreateUser *User `json:"createUser,omitempty"` UpdateUser *User `json:"updateUser,omitempty"` DeleteUser *User `json:"deleteUser,omitempty"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt *time.Time `json:"deletedAt,omitempty"` }
type PeerChangedEvent ¶
func (PeerChangedEvent) IsNodeChangedEvent ¶
func (PeerChangedEvent) IsNodeChangedEvent()
type PeerHook ¶
type PeerHook struct { Command string `json:"command"` RunOnCreate bool `json:"runOnCreate"` RunOnUpdate bool `json:"runOnUpdate"` RunOnDelete bool `json:"runOnDelete"` }
func ToPeerHook ¶
type PeerHookInput ¶
type PeerStats ¶
type PeerStats struct { LastHandshakeTime *time.Time `json:"lastHandshakeTime,omitempty"` ReceiveBytes float64 `json:"receiveBytes"` TransmitBytes float64 `json:"transmitBytes"` ProtocolVersion int `json:"protocolVersion"` }
func ToPeerStats ¶
type Server ¶
type Server struct { ID ID `json:"id"` Name string `json:"name"` Description string `json:"description"` Enabled bool `json:"enabled"` Running bool `json:"running"` PublicKey string `json:"publicKey"` ListenPort *int `json:"listenPort,omitempty"` FirewallMark *int `json:"firewallMark,omitempty"` Address string `json:"address"` DNS []string `json:"dns,omitempty"` Mtu int `json:"mtu"` Hooks []*ServerHook `json:"hooks,omitempty"` Peers []*Peer `json:"peers,omitempty"` InterfaceStats *ServerInterfaceStats `json:"interfaceStats,omitempty"` CreateUser *User `json:"createUser,omitempty"` UpdateUser *User `json:"updateUser,omitempty"` DeleteUser *User `json:"deleteUser,omitempty"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt *time.Time `json:"deletedAt,omitempty"` }
type ServerChangedEvent ¶
func (ServerChangedEvent) IsNodeChangedEvent ¶
func (ServerChangedEvent) IsNodeChangedEvent()
type ServerHook ¶
type ServerHook struct { Command string `json:"command"` RunOnCreate bool `json:"runOnCreate"` RunOnUpdate bool `json:"runOnUpdate"` RunOnDelete bool `json:"runOnDelete"` RunOnStart bool `json:"runOnStart"` RunOnStop bool `json:"runOnStop"` }
func ToServerHook ¶
func ToServerHook(hook *server.Hook) *ServerHook
type ServerHookInput ¶
type ServerInterfaceStats ¶
type ServerInterfaceStats struct { RxPackets float64 `json:"rxPackets"` TxPackets float64 `json:"txPackets"` RxBytes float64 `json:"rxBytes"` TxBytes float64 `json:"txBytes"` RxErrors float64 `json:"rxErrors"` TxErrors float64 `json:"txErrors"` RxDropped float64 `json:"rxDropped"` TxDropped float64 `json:"txDropped"` Multicast float64 `json:"multicast"` Collisions float64 `json:"collisions"` RxLengthErrors float64 `json:"rxLengthErrors"` RxOverErrors float64 `json:"rxOverErrors"` RxCrcErrors float64 `json:"rxCrcErrors"` RxFrameErrors float64 `json:"rxFrameErrors"` RxFifoErrors float64 `json:"rxFifoErrors"` RxMissedErrors float64 `json:"rxMissedErrors"` TxAbortedErrors float64 `json:"txAbortedErrors"` TxCarrierErrors float64 `json:"txCarrierErrors"` TxFifoErrors float64 `json:"txFifoErrors"` TxHeartbeatErrors float64 `json:"txHeartbeatErrors"` TxWindowErrors float64 `json:"txWindowErrors"` RxCompressed float64 `json:"rxCompressed"` TxCompressed float64 `json:"txCompressed"` }
func ToServerInterfaceStats ¶
func ToServerInterfaceStats(stats server.Stats) *ServerInterfaceStats
type SignInInput ¶
type SignInPayload ¶
type SignInPayload struct { ClientMutationID *string `json:"clientMutationId,omitempty"` // Token you can use this token in Authorization header as bearer type Token string `json:"token"` // Session expiration date time ExpiresAt time.Time `json:"expiresAt"` // Session expiration duration relative to current time in seconds ExpiresIn int `json:"expiresIn"` }
type StartServerInput ¶
type StartServerPayload ¶
type StopServerInput ¶
type StopServerPayload ¶
type Subscription ¶ added in v0.0.19
type Subscription struct { }
type UpdatePeerInput ¶
type UpdatePeerInput struct { ClientMutationID graphql.Omittable[*string] `json:"clientMutationId,omitempty"` ID ID `json:"id"` Name graphql.Omittable[*string] `json:"name,omitempty"` Description graphql.Omittable[*string] `json:"description,omitempty"` PublicKey graphql.Omittable[*string] `json:"publicKey,omitempty"` Endpoint graphql.Omittable[*string] `json:"endpoint,omitempty"` AllowedIPs graphql.Omittable[[]string] `json:"allowedIPs,omitempty"` PersistentKeepalive graphql.Omittable[*int] `json:"persistentKeepalive,omitempty"` Hooks graphql.Omittable[[]*PeerHookInput] `json:"hooks,omitempty"` }
type UpdatePeerPayload ¶
type UpdateServerInput ¶
type UpdateServerInput struct { ClientMutationID graphql.Omittable[*string] `json:"clientMutationId,omitempty"` ID ID `json:"id"` Description graphql.Omittable[*string] `json:"description,omitempty"` Enabled graphql.Omittable[*bool] `json:"enabled,omitempty"` PublicKey graphql.Omittable[*string] `json:"publicKey,omitempty"` PrivateKey graphql.Omittable[*string] `json:"privateKey,omitempty"` ListenPort graphql.Omittable[*int] `json:"listenPort,omitempty"` FirewallMark graphql.Omittable[*int] `json:"firewallMark,omitempty"` Address graphql.Omittable[*string] `json:"address,omitempty"` DNS graphql.Omittable[[]string] `json:"dns,omitempty"` Mtu graphql.Omittable[*int] `json:"mtu,omitempty"` Hooks graphql.Omittable[[]*ServerHookInput] `json:"hooks,omitempty"` }
type UpdateServerPayload ¶
type UpdateUserInput ¶
type UpdateUserPayload ¶
type User ¶
type UserChangedEvent ¶
func (UserChangedEvent) IsNodeChangedEvent ¶
func (UserChangedEvent) IsNodeChangedEvent()
Click to show internal directories.
Click to hide internal directories.