unix

package
v0.9.42 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package unix communicate internal access

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Get(ctx context.Context) (*Response, error)

	Close()
}

Client represents unix server client.

type IClient added in v0.9.31

type IClient struct {
	// contains filtered or unexported fields
}

IClient implements Client interface.

func NewClient

func NewClient(socketPath string) (*IClient, error)

NewClient initialize Client.

func (*IClient) Close added in v0.9.31

func (c *IClient) Close()

Close closes client connection.

func (*IClient) Get added in v0.9.31

func (c *IClient) Get(ctx context.Context) (*Response, error)

Get a response of connection.

type IServer added in v0.9.31

type IServer struct {
	// contains filtered or unexported fields
}

IServer implements Server interface.

func NewServer

func NewServer(socketPath string, timer timer.Timer) (*IServer, error)

NewServer initialize Server.

func (*IServer) Close added in v0.9.31

func (c *IServer) Close()

Close closes listener.

func (*IServer) Serve added in v0.9.31

func (c *IServer) Serve(ctx context.Context)

Serve start unix domain socket server.

type Response

type Response struct {
	RemainSec int `json:"remain_sec"`
}

Response represents unix server response.

func (*Response) GetRemain

func (r *Response) GetRemain() string

GetRemain get remain string.

type Server

type Server interface {
	Serve(ctx context.Context)
	Close()
}

Server represents server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL